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

Olaf van der Spek olaf at xwis.net
Sat Apr 10 12:26:01 UTC 2010


On 9-4-2010 8:37, sean finney wrote:
 >> 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.

It's a 'production' server, that can't be done.

 > * 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>  "$@"

I'll see if I can use valgrind.

 > 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.

Unfortunately not:
top:
  1969 www-data  20   0  351m 223m  17m S    0  2.8  31:01.91 php-cgi 
 
 

  1978 www-data  20   0  345m 217m  17m S    0  2.7  27:43.35 php-cgi 
 
 

  1970 www-data  20   0  334m 206m  17m S    0  2.6  21:55.99 php-cgi 
 
 

  2034 www-data  20   0  328m 200m  17m S    0  2.5  20:57.41 php-cgi

$ dpkg -l|grep php
ii  php5-cgi                            5.3.2-1 
server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                            5.3.2-1 
command-line interpreter for the php5 scripting language
ii  php5-common                         5.3.2-1                  Common 
files for packages built from the php5 source
ii  php5-gd                             5.3.2-1                  GD 
module for php5
ii  php5-mcrypt                         5.3.2-1                  MCrypt 
module for php5
ii  php5-mysql                          5.3.2-1                  MySQL 
module for php5
ii  php5-suhosin                        0.9.29-1+b1 
advanced protection module for php5
ii  php5-xcache                         1.3.0-6                  Fast, 
stable PHP opcode cacher
ii  phpmyadmin                          4:3.3.1-1                MySQL 
web administration tool

Olaf





More information about the pkg-php-maint mailing list