[Web-SIG] Daemon server management

Ian Bicking ianb at colorstudy.com
Fri Jun 10 17:36:02 CEST 2005


Rene Dudfield wrote:
> This is a great idea!  It gets around the problem of broken modules
> too.  If a module is updated on the live site, and it doesn't work for
> whatever reason, then the old server is still around to serve
> requests.

I hadn't thought about this aspect.  One problem with the reloader in 
Paste is that it can restart the server, and when there is a syntax 
error or something buggy in the startup code the whole server will die 
there.  Of course, I guess I could keep trying to restart the server 
regardless of its exit code, and just restart and restart until the bug 
gets fixed... but it would be better to leave the old one around until 
the new one shows at least some indication that it's ready to serve 
requests.

> Keeping the old server around until it has finished its requests would
> be good.  It would need to be told to stop handling new requests... 
> Like stop binding.  But then you still have a tiny window when they
> switch over that requests may get a connection refused message?  Still
> 100% better than the kill/start method.

One way that mod_webkit handles this (and PCGI and others -- but NOT 
SCGI, sadly) is it will keep retrying the connection for about 10 
seconds.  So connections during that downtime get caught in the gateway 
between Apache and the Python server, and eventually get through (as 
long as the server really does come back up).  It works quite well, and 
it's simple.

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Web-SIG mailing list