Fastcgi Error has failed to remain running for 30 seconds
Ahsan Imam <ahsan.imam-UDVVO4LZqMBWk0Htik3J/[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
We have the following server config on our current setup:
OS: Red Hat Linux release 7.2 (Enigma)
Mod_fastcgi version: mod_fastcgi-2.2.12-1
Apache: apache-1.3.27-3.7.2
We have a perl script with the above config and it works fine.
We are in the process of upgrading with the following config:
OS: SuSE Linux 9.2 (i586) VERSION = 9.2
Mod_fastcgi version: apache2-mod_fastcgi-2.4.2-2.rpm
Apache: apache2-prefork-2.0.50-7
When a static html page is requested, the perl script writes a file
(which it receives from an application server) to a caching directory.
On the new server the script seems to work fine initially, but after
sometime it starts spewing these errors:
Error: [Wed Mar 23 10:08:30 2005] [warn] FastCGI: (dynamic) server
"/home/httpd/fastcgi/cache.pl" has failed to remain running for 30
seconds given 3 attempts, its restart interval has been backed off to
600 seconds.
Sometimes the server runs fine for a hour and other times it just stops
responding within a few minutes. The only way to fix the problem is to
restart apache.
Also if we do a ps auxww | grep perl.script we see processes running
after we have shutdown apache. This symptom does not occur on the
current system.
We have the following questions:
1) What causes these errors?
2) Is there anything we can do to get rid of these errors, because when
it
happens the script hangs and apache returns an internal server error
(timeout)?
3) Why are the fastcgi perl script processes still around after apache
is shutdown?
Here is a template of our perl script and apache conf:
----------------------------------------------
use strict;
use FCGI;
my $handling_request = 0;
my $exit_requested = 0;
my $request = FCGI::Request();
$SIG{USR1} = \&sig_handler;
$SIG{TERM} = \&sig_handler;
$SIG{PIPE} = sub {die 'SIGPIPE\n';};
$| = 1;
while( $handling_request = ( $request->Accept() >= 0) ) {
eval {&abort_request;} if (!eval {&do_request; 1;} && $@ ne
'SIGPIPE\n');
$handling_request = 0;
last if $exit_requested;
}
$request->Finish();
exit(0);
sub sig_handler {
$exit_requested = 1;
exit(0) if !$handling_request;
}
sub abort_request() {
$exit_requested = 1; # assume the error isn't recoverable
print STDERR "fatal error, request aborted, shutting down: $@\n";
$request->Finish();
}
sub do_request(){
# Performs writes or delete of static html files
$request->Finish();
}
mod_fastcgi.conf
-------------------------
<IfModule !mod_fastcgi.c>
<Directory "/home/httpd/fastcgi">
AllowOverride None
Options None
Order allow,deny
Deny from all
</Directory>
</IfModule>
<IfModule mod_fastcgi.c>
ScriptAlias /fcgi-bin/ /home/httpd/fastcgi/
<Directory "/home/httpd/fastcgi">
AllowOverride None
Options +ExecCGI -Includes
SetHandler fastcgi-script
Order allow,deny
Allow from all
</Directory>
AddHandler fastcgi-script fcg fcgi fpl pl
</IfModule>
FastCGIConfig -maxClassProcesses 15
FastCgiConfig -restart-delay 5
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/