Unicorn 3.6.0 - HTTP server for fast clients and Unix

Unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels. Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between Unicorn and slow clients.

Changes: small fixes, PRNG workarounds

Mainly small fixes, improvements, and workarounds for fork() issues
with pseudo-random number generators shipped with Ruby (Kernel#rand,
OpenSSL::Random (used by SecureRandom and also by Rails).

The PRNG issues are documented in depth here (and links to Ruby
Redmine):

http://bogomips.org/unicorn.git/commit?id=1107ede7
http://bogomips.org/unicorn.git/commit?id=b3241621

If you’re too lazy to upgrade, you can just do this in your after_fork
hooks:

after_fork do |server,worker|
tmp = srand
OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random)
end

There are also small log reopening (SIGUSR1) improvements:

Eric W. [email protected] wrote:

If you’re too lazy to upgrade, you can just do this in your after_fork
hooks:

after_fork do |server,worker|
tmp = srand
OpenSSL::Random.seed(tmp.to_s) if defined?(OpenSSL::Random)
end

That was broken and made the problem worse, do this instead (or upgrade
to 3.6.1):

after_fork do |server,worker|
srand
OpenSSL::Random.seed(rand.to_s) if defined?(OpenSSL::Random)
end

This is why ruby-core should fix these problems because application
authors like me are too clumsy to be trusted :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs