Apache::SizeLimit ( mp1 and mp2 )-> I think there is a logical error in the code ...
[prev]
[thread]
[next]
[Date index for 2005/05/24]
This is a multi-part message in MIME format.
------_=_NextPart_001_01C56033.ABDCCCA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi folks,
=20
recently I deployed Apache::SizeLimit on a mod_perl 1.29 machine running =
SLES 9, since we had - ehm - runaway processes....
=20
After a while I stumbled across messages like this:
=20
/var/web/logs/error_log_modperl.3:[Tue May 17 20:45:04 2005] (21886) =
Apache::SizeLimit main process too big, SIZE=3D2003764 KB SHARE=3D21208 =
KB
/var/web/logs/error_log_modperl.3:[Tue May 17 20:56:49 2005] (21886) =
Apache::SizeLimit main process too big, SIZE=3D2003764 KB SHARE=3D21208 =
KB
/var/web/logs/error_log_modperl.3:[Tue May 17 21:02:42 2005] (21886) =
Apache::SizeLimit main process too big, SIZE=3D2003764 KB SHARE=3D21208 =
KB
/var/web/logs/error_log_modperl.3:[Tue May 17 21:07:02 2005] (21886) =
Apache::SizeLimit main process too big, SIZE=3D2003764 KB SHARE=3D21208 =
KB
and eventually read them in a way that actually hit my brain and I =
though: why does the main process grow and why is it serving requests ? =
I registered Apache::SizeLimit as a PerlCleanupHandler, so it should =
only be called for requests, right ? So I looked at the code and saw =
this:
=20
# wake up! time to die.
if ($WIN32 || (getppid > 1)) { # this is a child httpd
my $e =3D time - $START_TIME;
my $msg =3D "httpd process too big, exiting at =
SIZE=3D$size KB ";
$msg .=3D " SHARE=3D$share KB " if ($share);
$msg .=3D " REQUESTS=3D$REQUEST_COUNT LIFETIME=3D$e =
seconds";
error_log($msg);
=20
if ($WIN32) {
CORE::exit(-2); # child_terminate() is disabled in =
win32 Apache
} else {
$r->child_terminate();
}
=20
} else { # this is the main httpd, whose parent is init?
my $msg =3D "main process too big, SIZE=3D$size KB ";
$msg .=3D " SHARE=3D$share KB" if ($share);
error_log($msg);
}
=20
I claim, the "main process " detection does never work and does not make =
sense. Why? Not even when the apache is started on boot through init, =
the PPID will be 1, but some shell / rc pid. You can only find the PPID =
in the PID file that apache writes. But still: this should never be the =
case - right ?
=20
I checked Apache::SizeLimit for mod_perl 2 and found it mostly =
unchanged, so maybe this should be updated as:
=20
- if I am wrong and the main process goes through the cleanup phase, =
then we should read the PID file once at startup and test $$ against =
that PID
- if I am right, then the whole getppid stuff can just go away
=20
What do you think ?
=20
For my problem: I think that somehow the getppid does not work correctly =
with my perl 5.8.3 SLES9 / mp 1.29 / apache 1.3.29 combination -> I`ll =
try to scrap the getppid test and see, if the server will ever get =
killed...
cheers
Andreas Nolte
Leitung IT
-----------------------------------------------------------
arvato direct services
Olympiastra=DFe 1
26419 Schortens
Germany
<http://www.arvato.com/> http://www.arvato.com/
andreas.nolte@xxxxxxxxxxx.xx
Phone +49 (0) 4421 - 76- 84002
Fax +49 (0) 4421 - 76- 84111
=20
=20
=20
Andreas Nolte
Leitung IT
-----------------------------------------------------------
arvato direct services
Olympiastra=DFe 1
26419 Schortens
Germany
http://www.arvato.com/
andreas.nolte@xxxxxxxxxxx.xx
Phone +49 (0) 4421 - 76- 84002
Fax +49 (0) 4421 - 76- 84111
=20
=20
------_=_NextPart_001_01C56033.ABDCCCA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<TITLE>Nachricht</TITLE>
<META content=3D"MSHTML 6.00.2800.1498" name=3DGENERATOR></HEAD>
<BODY>
<DIV>
<DIV><SPAN class=3D462001106-20052005><FONT face=3DArial =
size=3D2>Hi <SPAN=20
class=3D399182008-23052005> <SPAN =
class=3D544083807-24052005>f</SPAN><SPAN=20
class=3D544083807-24052005>olks</SPAN></SPAN>,</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>recently I deployed Apache::SizeLimit on a =
mod_perl 1.29=20
machine running SLES 9, since we had - ehm - runaway=20
processes....</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>After a while I stumbled across messages like=20
this:</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>/var/web/logs/error_log_modperl.3:[Tue May 17 =
20:45:04 2005]=20
(21886) Apache::SizeLimit main process too big, SIZE=3D2003764 KB =20
SHARE=3D21208 KB<BR>/var/web/logs/error_log_modperl.3:[Tue May 17 =
20:56:49 2005]=20
(21886) Apache::SizeLimit main process too big, SIZE=3D2003764 KB =20
SHARE=3D21208 KB<BR>/var/web/logs/error_log_modperl.3:[Tue May 17 =
21:02:42 2005]=20
(21886) Apache::SizeLimit main process too big, SIZE=3D2003764 KB =20
SHARE=3D21208 KB<BR>/var/web/logs/error_log_modperl.3:[Tue May 17 =
21:07:02 2005]=20
(21886) Apache::SizeLimit main process too big, SIZE=3D2003764 KB =20
SHARE=3D21208 KB<BR></FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>and eventually read them in a way that actually =
hit my brain=20
and I though: why does the main process grow and why is it serving =
requests ? I=20
registered Apache::SizeLimit as a PerlCleanupHandler, so it should =
only be=20
called for requests, right ? So I looked at the code and saw=20
this:</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2> # wake up! time to=20
die.<BR>  =
; if=20
($WIN32 || (getppid > 1)) { # this is a =
child=20
httpd<BR> &nbs=
p; =20
my $e =3D time -=20
$START_TIME;<BR> &nb=
sp; =20
my $msg =3D "httpd process too big, exiting at SIZE=3D$size KB=20
";<BR> &=
nbsp; =20
$msg .=3D " SHARE=3D$share KB " if=20
($share);<BR> =
=20
$msg .=3D " REQUESTS=3D$REQUEST_COUNT LIFETIME=3D$e=20
seconds";<BR> =
=20
error_log($msg);</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial=20
size=3D2></FONT> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial=20
size=3D2> &nbs=
p; =20
if ($WIN32)=20
{<BR> &n=
bsp; =20
CORE::exit(-2); # child_terminate() is disabled in win32=20
Apache<BR> &nb=
sp; =20
} else=20
{<BR> &n=
bsp; =20
$r->child_terminate();<BR> &n=
bsp; =20
}</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial=20
size=3D2></FONT> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial=20
size=3D2> &nbs=
p; } else=20
{ # this is the main httpd, whose parent is=20
init?<BR> &nbs=
p; =20
my $msg =3D "main process too big, SIZE=3D$size KB=20
";<BR> &=
nbsp; =20
$msg .=3D " SHARE=3D$share KB" if=20
($share);<BR> =
=20
error_log($msg);<BR>  =
; =20
}</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>I claim, the "main process " detection does never =
work and=20
does not make sense. Why? Not even when the apache is started on boot =
through=20
init, the PPID will be 1, but some shell / rc pid. You can only =
find the=20
PPID in the PID file that apache writes. But still: this should never be =
the=20
case - right ?</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>I checked Apache::SizeLimit for mod_perl 2 and =
found it mostly=20
unchanged, so maybe this should be updated as:</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>- if I am wrong and the main process goes through =
the cleanup=20
phase, then we should read the PID file once at startup and test $$ =
against that=20
PID</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>- if I am right, then the whole getppid stuff can =
just go=20
away</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>What do you think ?</FONT></SPAN></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2></FONT></SPAN> </DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><SPAN =
class=3D462001106-20052005><FONT=20
face=3DArial size=3D2>For my problem: I think that somehow the getppid =
does not work=20
correctly with my perl 5.8.3 SLES9 / mp 1.29 / apache 1.3.29 combination =
->=20
I`ll try to scrap the getppid test and see, if the server will ever get=20
killed...</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial><BR><FONT=20
size=3D2></FONT></FONT></DIV></SPAN>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial =
size=3D2><SPAN=20
class=3D462001106-20052005>cheers</SPAN></FONT></DIV><!-- Converted from =
text/plain format -->
<P dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial =
size=3D2>Andreas=20
Nolte<BR>Leitung=20
IT<BR>-----------------------------------------------------------<BR>arva=
to=20
direct services<BR>Olympiastra=DFe 1<BR>26419 =
Schortens<BR>Germany<BR></FONT><A=20
href=3D"http://www.arvato.com/"><FONT face=3DArial color=3D#000000=20
size=3D2>http://www.arvato.com/</FONT></A><BR><BR><FONT size=3D2><FONT=20
face=3DArial>andreas.nolte@xxxxxxxxxxx.xx<BR>Phone +49 (0) =
4421 - 76-=20
84002<BR>Fax +49 (0) 4421 - 76-=20
84111<BR> </FONT><FONT face=3DArial> </FONT></FONT></P>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial=20
size=3D2></FONT> </DIV></DIV>
<DIV> </DIV><!-- Converted from text/plain format -->
<P><FONT size=3D2>Andreas Nolte<BR>Leitung=20
IT<BR>-----------------------------------------------------------<BR>arva=
to=20
direct services<BR>Olympiastra=DFe 1<BR>26419 Schortens<BR>Germany<BR><A =
href=3D"http://www.arvato.com/">http://www.arvato.com/</A><BR><BR>andreas=
.nolte@xxxxxxxxxxx.xx<BR>Phone =20
+49 (0) 4421 - 76- 84002<BR>Fax +49 (0) 4421 - =
76-=20
84111<BR> </FONT> </P>
<DIV> </DIV></BODY></HTML>
------_=_NextPart_001_01C56033.ABDCCCA0--
 |
Apache::SizeLimit ( mp1 and mp2 )-> I think there is a logical error in the code ...
07:39 on 24 May 2005
|