Derick
Increasing Memory Usage
March 31, 2009 11:19AM
Hello,

I am using Nginx 0.7.43 with php-fpm(php 5.2.8) on Debian 5. I have
observed a strange behavior:

When I compiled and installed it, the total memory usage of my VPS was
91 M. After some time it became 131M and is increasing slowly. Now it
stands at 191M. I suspect some memory leak.

blankdot@alpha:~$ free -m
total used free shared buffers
cached
Mem: 512 191 320 0
0 0
-/+ buffers/cache: 191 320
Swap: 0 0 0

blankdot@alpha:~$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME
COMMAND
root 1 0.0 0.1 1904 688 ? Ss Mar29 0:00 init
[2]
root 20313 0.0 0.2 34104 1312 ? Sl Mar29 0:00 /usr/
sbin/rsyslogd -c3
root 20326 0.0 0.1 5212 1000 ? Ss Mar29 0:00 /usr/
sbin/sshd
99 20345 0.0 0.1 12092 796 ? S Mar29 0:00 /usr/
sbin/maradns -f /etc/maradns/mararc
root 20346 0.0 0.1 1560 532 ? S Mar29 0:00
logger -p daemon.notice -t maradns.etc_maradns_mararc
root 20376 0.0 0.2 2624 1300 ? S Mar29 0:00 /bin/
sh /usr/bin/mysqld_safe
mysql 20415 0.0 2.4 61236 12680 ? Sl Mar29 0:15 /usr/
sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-
file=/var/run/my
root 20416 0.0 0.1 1560 536 ? S Mar29 0:00
logger -p daemon.err -t mysqld_safe -i -t mysqld
root 21537 0.0 0.9 8160 4728 ? S Mar29 0:00
python /usr/sbin/denyhosts --daemon --purge --config=/etc/
denyhosts.conf --config=/etc/denyh
104 21804 0.0 0.1 6112 928 ? Ss Mar29 0:00 /usr/
sbin/exim4 -bd -q30m
root 21808 0.0 0.3 6884 1744 ? Ss Mar29 0:00
nginx: master process /usr/sbin/nginx
www-data 21809 0.0 0.5 7452 2716 ? S Mar29 0:04
nginx: worker process
root 21812 0.0 0.4 14324 2312 ? Ss Mar29 0:00 /usr/
local/bin/php-cgi --fpm --fpm-config /usr/local/etc/php-fpm.conf
www-data 21813 0.1 3.9 29112 20908 ? S Mar29 3:04 /usr/
local/bin/php-cgi --fpm --fpm-config /usr/local/etc/php-fpm.conf
www-data 21814 0.1 3.8 29044 20308 ? S Mar29 3:02 /usr/
local/bin/php-cgi --fpm --fpm-config /usr/local/etc/php-fpm.conf
www-data 21815 0.1 3.1 25372 16348 ? S Mar29 3:09 /usr/
local/bin/php-cgi --fpm --fpm-config /usr/local/etc/php-fpm.conf
root 21835 0.0 0.1 1972 792 ? Ss Mar29 0:00 /usr/
sbin/cron
www-data 11619 0.1 3.4 26488 18224 ? S Mar29 2:59 /usr/
local/bin/php-cgi --fpm --fpm-config /usr/local/etc/php-fpm.conf
www-data 11857 0.1 3.9 29424 20484 ? S Mar29 3:04 /usr/
local/bin/php-cgi --fpm --fpm-config /usr/local/etc/php-fpm.conf
root 23705 0.0 0.4 7968 2612 ? Ss 15:13 0:00 sshd:
blankdot [priv]
blankdot 23736 0.0 0.2 7968 1528 ? S 15:13 0:00 sshd:
blankdot@pts/0
blankdot 23737 0.0 0.3 3264 1828 pts/0 Ss 15:13 0:00 -bash
blankdot 26348 0.0 0.1 2236 900 pts/0 R+ 15:18 0:00 ps
aux
Momchil Ivanov
Re: Increasing Memory Usage
March 31, 2009 12:37PM
На Tuesday 31 March 2009 17:19:44 Derick написа:
> Hello,
>
> I am using Nginx 0.7.43 with php-fpm(php 5.2.8) on Debian 5. I have
> observed a strange behavior:
>
> When I compiled and installed it, the total memory usage of my VPS was
> 91 M. After some time it became 131M and is increasing slowly. Now it
> stands at 191M. I suspect some memory leak.

I have been seeing some memory leaks with php 5.2.6 (with memcache and
eaccelerator as modules). Basically all php scripts start to consume much
more memory fater some time (the increase was stepwise). The solution I chose
was sending SIGUSR2 to the fpm process every 2 hours on all php nodes. You
should log your memory usage as reported by php and if you see the same step
increases, decide upon a time interval for sending SIGUSR2 to the process
manager.

Momchil

--
This correspondence is strictly confidential. Any screening, filtering
and/or production for the purpose of public or otherwise disclosure is
forbidden without written permission by the author signed above. If you are
not the intended recipient, please immediately notify the sender and
permanently delete any copies

PGP KeyID: 0x3118168B
Keyserver: pgp.mit.edu
Key fingerprint BB50 2983 0714 36DC D02E  158A E03D 56DA 3118 168B
adi
Re: Increasing Memory Usage
March 31, 2009 01:36PM
Hi.
PHP 5.2.8 have some issues with memory leak (once I have one process php-cgi consumed 600 MB RAM ;)) try 5.2.9

Best regards
Re: Increasing Memory Usage
April 14, 2009 11:52AM
has anyone validated 5.2.9 does not suffer from the "same" memory leak
that 5.2.8 did with 5.2.9 + the unofficial 5.2.9 php-fpm patch?

I hope Andrei is okay. He's disappeared off the face of the earth now
for a while.

On Tue, Mar 31, 2009 at 10:36 AM, adi <nginx-forum@nginx.us> wrote:
>
> Hi.
> PHP 5.2.8 have some issues with memory leak (once I have one process php-cgi consumed 600 MB RAM ;)) try 5.2.9
>
> Best regards
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,670,676#msg-676
>
>
Alexey V. Karagodov
Re: Increasing Memory Usage
April 14, 2009 12:33PM
yes, Andrei is OK
:)

On 14.04.2009, at 19:52, Michael Shadle wrote:

>
> has anyone validated 5.2.9 does not suffer from the "same" memory leak
> that 5.2.8 did with 5.2.9 + the unofficial 5.2.9 php-fpm patch?
>
> I hope Andrei is okay. He's disappeared off the face of the earth now
> for a while.
>
> On Tue, Mar 31, 2009 at 10:36 AM, adi <nginx-forum@nginx.us> wrote:
>>
>> Hi.
>> PHP 5.2.8 have some issues with memory leak (once I have one
>> process php-cgi consumed 600 MB RAM ;)) try 5.2.9
>>
>> Best regards
>>
>> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,670,676#msg-676
>>
>>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 260
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready