--Apple-Mail-3-555745201
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit
Hello
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
--Apple-Mail-3-555745201
Content-Type: text/html;
charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Hello<div><br></div><div>I'm =
running Perl programs in mod_perl in Apache (2.2) on RHEL, using the =
prefork MPM.</div><div>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 <span class=3D"Apple-style-span" =
style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: =
'Times New Roman'; font-style: normal; font-variant: normal; =
font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; font-size: medium; "><span =
class=3D"Apple-style-span" style=3D"font-family: Verdana; font-size: =
13px; "><a =
href=3D"http://search.cpan.org/%7Egozer/mod_perl-2.0.4/docs/ api/Apache2/Si=
zeLimit.pod" id=3D"j:1-" =
title=3D"Apache2::SizeLimit">Apache2::SizeLimit</a></span></span>. =
Processes that grow to large die with "Out of Memory!" and =
"Callback called exit."</div><div>I had hoped to give some users some =
feedback via Apache's <a =
href=3D"http://httpd.apache.org/docs/2.0/mod/core.html#error document">Erro=
rDocument</a> (also described in <a =
href=3D"http://httpd.apache.org/docs/2.0/custom-error.html"> Custom Error =
Response</a>). While that can run local Perl (in a new process of =
course) as in the example</div><div><div><font =
size=3D"+1"><code> </code></font><span =
class=3D"Apple-style-span" style=3D"border-collapse: separate; color: =
rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 20px; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-indent: =
0px; text-transform: none; white-space: normal; widows: 2; word-spacing: =
0px; "><span class=3D"Apple-style-span" style=3D"font-family: 'Courier =
New', Courier, monospace; font-size: 19px; line-height: 20px; =
">ErrorDocument 500 =
/cgi-bin/crash-recover.pl</span></span></div></div><div>exiting process =
doesn't trigger ErrorDocument 500. </div><div>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.</div><div><br></div><div>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?</div><div><br></div><div>BR</div><div>A</div><div><br></div></body></=
html>=
--Apple-Mail-3-555745201--
