[LA.pm] Problem with FastCGI under Apache 2
Peter Benjamin
pete at peterbenjamin.com
Thu Feb 9 15:48:01 PST 2006
Is there a variable for the idle time before being put to sleep?
At 03:21 PM 2/9/2006, Benjamin J. Tilly wrote:
>Solutions to that could include carefully testing whether the database connection works (and reconnecting if need be) on every request, or having the script wake itself up periodically to do something trivial with the database.
For CGI scripts I have written that take 2-5 minutes to execute
large database transfers I will output a 'status' update to the
reply web page, every 5000 iterations, or a period that is well
inside the Apache default 45 seconds to kill any CGI script
running that long without any STDOUT. Works fine.
Perhaps a similar method to keep the script from sleeping?
Never let it sleep is the point. One might invoke
the script(s) making web requests? Add a GET parameter
just for that purpose and every minute query the script.
When that parameter is set, the script just returns a
hello world web page, instead of complex processing.
Bandaid solution for sure.
Use cron with wget or fetch or lynx or ...
This could be done right on the web server itself.
More information about the Losangeles-pm
mailing list