Openssl Causing Very Slow Rails Boot Time on Windows

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



Leave a reply



Submit