OpenSSL causing very slow Rails boot time on Windows
Edit-2: I ran ruby-prof on Rails.application.initialize and found the
culprit. A process was taking up 85% of the run time:<Module::SecureRandom>#random_bytes
<Module::OpenSSL::Random>#random_bytes
Yeah, the OpenSSL code for seeding the random number generator is problematic on Windows. See Random Numbers and Windows Issues on the OpenSSL wiki.
return OpenSSL::Random.random_bytes(n)
So anyone have any idea what this means?
Ruby is returning random numbers. In this case, OpenSSL will autoseed itself before retuning random number with RAND_poll
since no other seed was provided.
Ruby should not call RAND_poll
or allow it to be implicitly called by the library. If the random number generator has not been seeded, then the library will automatically seed itself by calling RAND_poll
internally.
Rather, Ruby should read bytes from the OS using CryptGenRandom
, and then call OpenSSL's RAND_seed
. That will avoid the call to RAND_poll
.
Windows alternative to zeus and spring for rails
You can use spork as alternative to spring https://github.com/sporkrb/spork
Cucumber (even without rails) Very Slow
I have the same issues with Cucumber being extremely slow. One major improvement you can make to the startup time is to upgrade to Ruby 1.9.3 with this patch. On my machines I've seen a 30% speedup in startup time.
Very slow mysql
Thanks for your answers.
I try to restart my mysql server but nothing change. About the cpu and ram, nothing wrong, my cpu is around 2% and I have 100Mo free for 1 Go installed.
I run OPTIMIZE TABLE on all tables but the problem is still here.
But, I analyse I/O hard disk and my hard disk write many things every time. I have an average of 75.33 requests/secondes which write on my disk.
The problem is may be here. How know what program write every time ?
Very slow mysql
Thanks for your answers.
I try to restart my mysql server but nothing change. About the cpu and ram, nothing wrong, my cpu is around 2% and I have 100Mo free for 1 Go installed.
I run OPTIMIZE TABLE on all tables but the problem is still here.
But, I analyse I/O hard disk and my hard disk write many things every time. I have an average of 75.33 requests/secondes which write on my disk.
The problem is may be here. How know what program write every time ?
Related Topics
Nameerror: Undefined - Have Parsing Rules for Local Variables Changed in Ruby 2.1.2
Calling Ruby Method Without Instantiating Class
Determining Method's Visibility on the Fly
How to Refer to a Submodule's "Full Path" in Ruby
Getting Hash with Symbol as Keys for Mongo in Rails
Regexp Search Through a Very Large File
Uml Sequence Diagram - How to Represent Method Arguments That Instantiate Objects
Ruby Regexp to Replace Equations
How to Collapse Double Splat Arguments into Nothing
Using the Right Exception Subclass in Ruby
Openssl Causing Very Slow Rails Boot Time on Windows
Error Requiring Pg Under Rvm with Postgres.App
How to Call a JavaScript Function from an HTML.Erb
Jekyll:New Posts Not Being Generated
How to Sort So That "Vitamin B12" Is Not in Front of "Vitamin B6"
Testing HTML5 File Upload with Capybara/Selenium Webdriver - Ruby