Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

mod_perl does not, unfortunately, have a way of doing this. What does have a way of implementing timeouts its mod_fcgid (via the FcgidBusyTimeout directive). This shouldn't require any significant modifications to your script, unless its making use of mod_perl specific functionality.

A good comparison between mod_perl and mod_fcgid is available on StackOverflow, but if implementing universal timeouts is your requirement, mod_fcgid sounds like its the only way to go.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.