Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: JRuby 1.7.0.pre2
-
Component/s: Performance, Ruby 1.9.3, Standard Library, Windows
-
Labels:
-
Environment:Windows 7 x64, Java JDK 6_32 and 7_4, Rails 3.2.3, JRuby 1.6.7 and 1.6.7.2
-
Number of attachments :3
Description
There is a very long delay (~100 seconds) when deserializing the Rails unicode DB using Marshal.load running in WEBrick.
File.open(ActiveSupport::Multibyte::Unicode::UnicodeDatabase.filename, 'rb')
{ |f| puts 'start loading unicode db' Marshal.load f.read puts 'finished loading unicode db' }
This is a 800kb binary file, the issue appears to be WEBrick specific, as it does not occur in Rails Console or when running the JRuby app using winstone.
Please see attached file with sample app, and refer to "home/index" action.
Thanks,
Keith
-
Hide
- long_delay_prof_dumps.zip
- 05/Jun/12 10:02 AM
- 22 kB
- Keith Gaputis
-
- webrick_jstack_pc2_1.txt 65 kB
- webrick_jstack_pc2_2.txt 65 kB
- webrick_out_pc1_1.txt 13 kB
- webrick_out_pc1_2.txt 12 kB
- webrick_out_pc2_1.txt 19 kB
- webrick_out_pc2_2.txt 12 kB
-
Hide
- long_delay.zip
- 02/May/12 4:41 PM
- 360 kB
- Keith Gaputis
-
- long_delay/.gitignore 0.4 kB
- long_delay/app/assets/images/rails.png 6 kB
- long_delay/app/.../application.js 0.6 kB
- long_delay/app/.../home.js.coffee 0.2 kB
- long_delay/app/.../application.css 0.5 kB
- long_delay/app/.../stylesheets/home.css.scss 0.2 kB
- long_delay/app/.../application_controller.rb 0.1 kB
- long_delay/app/.../home_controller.rb 0.2 kB
- long_delay/app/.../application_helper.rb 0.0 kB
- long_delay/app/helpers/home_helper.rb 0.0 kB
- long_delay/app/mailers/.gitkeep 0.0 kB
- long_delay/app/models/.gitkeep 0.0 kB
- long_delay/app/views/home/index.html.erb 0.1 kB
- long_delay/app/.../application.html.erb 0.2 kB
- long_delay/config/application.rb 3 kB
- long_delay/config/boot.rb 0.2 kB
- long_delay/config/database.yml 0.5 kB
- long_delay/config/environment.rb 0.1 kB
- long_delay/config/.../development.rb 1 kB
- long_delay/config/.../production.rb 2 kB
- long_delay/config/environments/test.rb 1 kB
- long_delay/config/.../backtrace_silencers.rb 0.4 kB
- long_delay/config/.../inflections.rb 0.5 kB
- long_delay/config/.../mime_types.rb 0.2 kB
- long_delay/config/.../secret_token.rb 0.5 kB
- long_delay/config/.../session_store.rb 0.4 kB
- long_delay/config/.../wrap_parameters.rb 0.5 kB
- long_delay/config/locales/en.yml 0.2 kB
- long_delay/config/routes.rb 2 kB
- long_delay/config.ru 0.2 kB
-
- marshal_output
- 06/Jun/12 4:02 PM
- 116 kB
- Xavier Shay
Activity
Charles, thank you for looking into this. I missed the notification email from your response a couple weeks back.
I have recreated this problem on both my win7 x64 development machines. Please see attached zip file for server and jstack output from both machines when using -Xprof.
- Execution 1 in both cases is a Ctrl+\ during hanging request followed by Ctrl+C once it finally finishes
- Execution 2 in both cases is a Ctrl+C during hanging request
Thanks, please let me know what I can do to help further if you cannot recreate this.
I am seeing this in development mode also, but only when the database is loaded within the context of a web request using webrick.
If I load it on server startup it works fine.
I cannot reproduce using thin.
Still trying to cut down a minimal test case. Attaching jstack output.
On OSX.
jstack output when JRuby is taking forever to Marshal load unicode database.
Confirm I can reproduce with Keith's stripped down test case on jruby-1.6.7.2.
It occurs in both 1.8 and 1.9 modes, takes about twice as long in 1.9.
From the -Xprof dumps it looks like transcoding is to blame here. It's possible we are (or were) transcoding too much or too often or unnecessarily.
I'll try to reproduce again on master today.
Well it's hard to tell, but it seems to be ok on master. In 1.9 mode, I did bundle exec rails s, which started up WEBrick. I hit /home/index, and after chewing for a second it returned. Subsequent requests sped up.
I'll call this resolved. If someone else can reproduce the slowness, reopen and we'll try to investigate further.
I am so far unable to reproduce this...it runs in well under a second for me on JRuby master and 1.6.7, on Java 6 and 7.
A few things for you to try: