[ANN] unicorn 3.6.0 - HTTP server for fast clients and Unix

Discussion in 'Ruby' started by Eric Wong, Apr 21, 2011.

  1. Eric Wong

    Eric Wong Guest

    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.

    * http://unicorn.bogomips.org/
    *
    * git://bogomips.org/unicorn.git

    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:

    * relative paths may also be reopened, there's a small chance this
    will break with a handful of setups, but unlikely. This should
    make configuration easier especially since the "working_directory"
    configurator directive exists. Brought up by Matthew Kocher:
    http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/900

    * workers will just die (and restart) if log reopening fails for
    any reason (including user error). This is to workaround the issue
    reported by Emmanuel Gomez:
    http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/906

    --
    Eric Wong
    Eric Wong, Apr 21, 2011
    #1
    1. Advertising

  2. Eric Wong

    Eric Wong Guest

    Eric Wong <> 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 :)

    --
    Eric Wong
    Eric Wong, Apr 27, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric Wong
    Replies:
    2
    Views:
    99
    Eric Wong
    Mar 20, 2009
  2. Eric Wong
    Replies:
    1
    Views:
    149
    Suraj Kurapati
    Sep 5, 2009
  3. Eric Wong
    Replies:
    1
    Views:
    281
    Eric Wong
    Oct 3, 2009
  4. Eric Wong
    Replies:
    0
    Views:
    112
    Eric Wong
    Jan 8, 2010
  5. Eric Wong
    Replies:
    0
    Views:
    117
    Eric Wong
    May 5, 2010
Loading...

Share This Page