Fwd: Support for Soft Timeout in Unicorn

Eric Wong normalperson at yhbt.net
Thu Jun 3 14:47:30 EDT 2010

Pierre Baillet <oct at fotonauts.com> wrote:
> Eric,
> On Thu, Jun 3, 2010 at 8:22 PM, Eric Wong <normalperson at yhbt.net> wrote:
> > This would be doable as middleware, too, and if done carefully, even
> > safely reusable in multi-threaded web servers.  This would be a good
> > addition to rack-contrib, even.  I might consider doing it myself if I
> > had time.
> I also think that doing this as a Rack middleware is probably the
> right way to do that kind of worker management. However the
> application we use at fotopedia is still Rails 2.1 based (hence not
> Rack compatible AFAIK). This probably means we'll have keep on
> maintaining this slightly hacked version on our own then.

Actually, internally, Unicorn only knows about Rack and wraps older
CGI-based Rails using the Unicorn::App::OldRails application (via

"unicorn_rails" basically wraps up the following config for you,
but you could achieve the same effect using "unicorn" and an
explicitly written config.ru:

------------ config.ru -------------
require 'config/boot'
require 'config/environment'
require 'unicorn/app/old_rails'
require 'unwritten_timeout_middleware'
use UnwrittenTimeoutMiddleware # :)
use Unicorn::App::OldRails::Static # optional
run Unicorn::App::OldRails.new

> Thank you for Unicorn ! :)

No problem :)

Eric Wong

More information about the mongrel-unicorn mailing list