perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Moseley <>
Subject Re: Detecting graceful restart/stop in child processes
Date Mon, 07 Dec 2009 15:01:49 GMT
On Mon, Dec 7, 2009 at 1:18 AM, André Warnier <> wrote:

> Bill Moseley wrote:
>> Again, I've got keep alives set for a long time.
> Well, isn't that your problem then ?
KeepAlive connections were introduced at a time when establishing and
> tearing down TCP connections were relatively expensive things to do.
> With modern servers however, this is less important.
> By setting KeepAliveTimeOut long, you essentially "block" a child (and all
> its resources), doing nothing but waiting for a follow-up request, for a
> long time after the last related request from the browser has come in, for
> the dubious benefit of avoiding the setup of a new connection.

This is true for my test environment I described, but that was just for
testing and was on purpose.

Under production a load balancer is used between the client and the
Apache/mod_perl servers.  It works as a proxy where the connection to the
client is separate from the connection to the pool of backend processes on
each server.  The balancer manages this pool of persistent connections ready
to handle requests.  Clients make separate persistent connections on the
front of the balancer, too.  But these are not directly connected to any one
process.  Requests come in from the presistent clients and the balancer
finds a free backend process to handle the request.  The backend services
the request very quickly and then is available to service other requests
while the client receives its response.  The keep-alive timeouts are
different on both sides of the balancer.

If the balancer maintains persistent connections to the back-end processes
then the problem is how to gracefully shut down a server.  Just doing a
graceful stop won't work because the connections keeps the process alive.
One way is to pull the server from the balancer  pool, wait for existing
requests to finish (only a few seconds) and then stop the server.   Problem
there is that it's not always the same people running the web servers and

So, it would be more convenient if a graceful restart could be done on just
Apache and that would trigger closing the connections on the next response
freeing up the process to exit.  That's the part I'm trying to get working.

Bill Moseley

View raw message