Mod_Layout + PHP + a very large Ouput => Server unusable (Memory usage to high)
"Stefan" <[email protected]> Sun, 20 Jul 2008 19:18:39 +0200
| Newsgroups | gmane.comp.apache.mod-layout |
|---|---|
| Message-ID | <80A920F65A0842ABBA47F06EAC201C74@MedienPC> |
This is a multi-part message in MIME format.
--===============4340301704811494095==
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0029_01C8EA9D.6A61D2A0"
This is a multi-part message in MIME format.
------=_NextPart_000_0029_01C8EA9D.6A61D2A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
My problem is the same like here: =
http://lists.tangent.org/pipermail/mod_layout/2008-February/002364.html
Can someone tell me, how to fix it? A little Script which kills Apache =
processes that need to much memory doesn't really work. When u have a =
PHP script, which runs in an endless loop and produces much conent (e.g. =
Errors) the Apache will "eat" all the memory (inc. swap) which makes =
your server nearly to stop working. If you have a bit luck you can login =
over ssh (5-10 Minutes till the loginscreen appeared) or you have to =
call the computer center and ask them to restart your server.
A script which causes such a usage could look like this (We have a =
Freehoster and there are always people that make such mistakes and we =
had it 3 times now :( )
<?php
$fh =3D fopen('test.txt', 'r');
while(!feof($fh))
fgets($fh);
fclose($fh);
?>
If the file doesn't exists in addition to the wrong ! infront of feof() =
you will get an endless loop with uncountable error-messages
=3D=3D> Apache needs all memory without ANY replace done by the Module.
Sorry for my bad english. I hope you understand, what i try to say and i =
hope, that it will and can be fixed.
Greets
Stefan Grubisic
------=_NextPart_000_0029_01C8EA9D.6A61D2A0
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=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.5583" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>My problem is the same like here: =
</FONT><FONT=20
face=3DArial size=3D2><A=20
href=3D"http://lists.tangent.org/pipermail/mod_layout/2008-February/00236=
4.html">http://lists.tangent.org/pipermail/mod_layout/2008-February/00236=
4.html</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Can someone tell me, how to fix it? A =
little Script=20
which kills Apache processes that need to much memory doesn't really =
work. When=20
u have a PHP script, which runs in an endless loop and produces much =
conent=20
(e.g. Errors) the Apache will "eat" all the memory (inc. swap) which =
makes your=20
server nearly to stop working. If you have a bit luck you can login over =
ssh=20
(5-10 Minutes till the loginscreen appeared) or you have to call the =
computer=20
center and ask them to restart your server.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>A script which causes such a =
usage could look=20
like this (We have a Freehoster and there are always people that make =
such=20
mistakes and we had it 3 times now :( )</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><?php</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>$fh =3D fopen('test.txt', =
'r');</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>while(!feof($fh))</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
fgets($fh);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>fclose($fh);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>?></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If the file doesn't exists in addition =
to the wrong=20
! infront of feof() you will get an endless loop with uncountable=20
error-messages</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>=3D=3D> Apache needs all memory =
without ANY replace=20
done by the Module.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Sorry for my bad english. I hope you =
understand,=20
what i try to say and i hope, that it will and can be =
fixed.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Greets</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Stefan =
Grubisic</FONT> </DIV></BODY></HTML>
------=_NextPart_000_0029_01C8EA9D.6A61D2A0--
--===============4340301704811494095==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Mod_layout mailing list
[email protected]
http://lists.tangent.org/mailman/listinfo/mod_layout
--===============4340301704811494095==--