[Mongrel-development] [ANN] Unicorn: UNIX+localhost/LAN-only Mongrel fork

Eric Wong normalperson at yhbt.net
Wed Feb 11 19:59:32 EST 2009

Ryan Dahl <ry at tinyclouds.org> wrote:
> Eric,
> this sounds great.
> what would you think of adding an option to allow the server to
> connect to one (or more?) unix pipes for process restart instructions?
> i'd love to add a nginx module which notices when a backend is
> responding too slowly and can notify Unicorn to restart it. (this is
> the killer feature of passenger phusion.)
> a simple protocol where a single byte message encodes the index of the
> backend that needs to be restarted would work i think (easy to
> multiplex with multiple writer processes)

Hi Ryan,

Something like this should already be doable via various means

Workers already process SIGQUIT to gracefully stop; so I'd rather not
reinvent that part even with a very simple protocol.

The master process already notices when timeout is expired and sends
SIGKILL to workers.  I could add a :soft_timeout config and have it send
SIGQUIT to workers if a lower timeout is reached.

On the other hand, I could see implementing soft_timeout having
statistics+heuristics, being URL/action-aware.  So IMHO this could be
more completely implemented as a separate package that watches the logs
via `tail -F`.  That way one can define which actions are allowed
to take longer without affecting the timeout (connecting to external
services for example).

As much as I love nginx, I'm really not a fan of adding modules and
increasing the complexity of the nginx process.  Yeah, I'm pretty
firmly on the "cat -v considered harmful" side of the fence :)

Eric Wong

More information about the Mongrel-development mailing list