httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: Watchdog code for Apache
Date Sat, 04 Jun 2005 17:41:07 GMT
On 6/4/05, Nick Kew <> wrote:
> It also seems better for the watchdog code to run in Apache's
> master process than to fork off a separate process.
> My current thinking is to use ap_wait_or_timeout and:

create a hook that runs there

> * go through the scoreboard looking for threads tied up in a
>   request that's gone on too long.
> * send SIGUSR2 to the process
> * return with set to the process for the MPM to deal with

maybe mpms implement an optional function that a module could call to
do process management work?

even when the MPM doesn't implement that function, it is still useful
to have a module identify stuck requests

> Then the per-process signal handler is reduced to setting a flag
> for the MPM to deal with.  Now the MPM can at worst terminate it
> cleanly, perhaps using the graceful restart code on the process.

for threaded MPM, graceful shutdown doesn't help, since you now have
an entire hung process which is doing no useful work instead of a
process where n-1 threads are doing useful work and 1 thread is hung

> Questions:
> * Any objections in principle to adding watchdog code in this manner?

IMHO it should be in separate module and invoke high level services
optionally provided by the MPM in order to do dirty work

> * Does this plan make sense?
> * Is there a better plan that'll enable me to get down to thread level
>   and stop just the errant thread?  Perhaps the above with an optional
>   thread-shutdown hook somewhere?

unclear to me what can be done in a threaded MPM

View raw message