[php-maint] Bug#577009: Bug#577009: php5-cgi: php-cgi uses 500+ mb memory

sean finney seanius at debian.org
Fri Apr 9 06:37:41 UTC 2010


On Thu, Apr 08, 2010 at 11:35:42PM +0200, Olaf van der Spek wrote:
> >  * are you using the cgi's directly or do you have some kind of fcgi wrapper?
> 
> I'm using Lighttpd.
> 
> >  * is it a slow or sudden increase?
> 
> Slow
> 
> >  * is there a sample code/script/page that can trigger this?
> 
> I don't know, there are several sites hosted, one Invision Power
> Board. I've no idea what triggers the leak.
> 
> >  * can you try installing php5-dbg and run the php-cgi wrapped by valgrind?
> 
> What should I look for?

this definitely sounds like leaky behavior, so without knowing more about
lighthttpd/fastcgi setups, i can only give a general suggestion:

* reduce the number of threads/children to one.
* set the executable path for the "cgi" script to a wrapper script that
  calls valgrind (preserving cmdline arguments to the underlying cgi).
* look for leak errors in the valgrind output.
* additionally, if there's some kind of "max requests" per child before
  it's replaced with a new child, set it to something small and then send
  that many requests so you can get teh end-of-process report from valgrind.

the wrapper script would look something like

valgrind --leak-check=full <cgi> "$@"

it's possible (i'd say, expected even) that there will be other errors in
the output as well, so you'll have to sift through them and look for errors
for memory that is definitely lost.  but i'd try upgrading first as suggested
by rafael/ondrej, as it might solve your problem for free.


	sean
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20100409/3ef9ea96/attachment.pgp>


More information about the pkg-php-maint mailing list