I'm looking for a server-wide setting for timeout with mod_perl scripts under Apache 2.2, similar to max_execution_time in php.
Timeout can be done with $SIG{ALRM} but it requires modification to every perl script and is incompatible with with sleep().
Apache has a TimeOut configuration directive, however it has no effect on mod_perl. With TimeOut 5, timeout does not occur for a test script that sleeps for 10 seconds before printing anything.
The Apache2::ServerRec module has a timeout() method, but it simply gets/sets the value of Apache's TimeOut variable, and therefore has no effect on mod_perl as well.
How can it be done? If it cannot be done, what is the best practice for timeout in mod_perl?