httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ARTHUR GOLDBERG <a...@cs.nyu.edu>
Subject [users@httpd] Exiting process doesn't trigger ErrorDocument 500
Date Mon, 22 Mar 2010 16:50:21 GMT
Hello All

Resending, as nobody replied.

Is there a way to get a mod_perl process that dies with "out of  
memory" trapped by the "ErrorDocument 500" handler?

I'm running Perl programs in mod_perl in Apache (2.2) on RHEL, using  
the prefork MPM.
I want to protect my server against Perl processes that grow much too  
large, as they can slow or even freeze the system. So I've setup an  
address space resource limit via Perl's Apache2::SizeLimit. Processes  
that grow to large die with "Out of Memory!" and "Callback called exit."
I had hoped to give some users some feedback via Apache's  
ErrorDocument (also described in Custom Error Response). While that  
can run local Perl (in a new process of course) as in the example
        ErrorDocument 500 /cgi-bin/crash-recover.pl
exiting process doesn't trigger ErrorDocument 500.
Alternatively, I tried to output status to users via a SIG handler for  
__DIE__, but STDERR is closed by the time the SIG handler runs.

Is there a way to configure this, or another way to provide some error  
output to a browser that sent a Request that caused the server process  
to die?

BR
A


Mime
View raw message