Tomasz Chmielewski schrieb:
I have Apache 2.2.3 server, which over time (a couple of days) uses lots of memory. What uses lots of memory? Apache processes which do not want to die for some reason.The server can have only 10-20 active connections to httpd (as reported by netstat's ESTABLISHED), but in the same time, there can be 80, 100, 120 or more httpd processes (the longer httpd was not restarted, the more httpd processes will run, till memory and swap are full and OOM-killer will start to kill processes).Short term, httpd processes are created and killed (exit), but longer term, after several hours, I can see that more and more httpd processes are running.How can I trace what causes this misbehaviour? Perhaps it's some PHP code which never exits. I always used strace to check various malfunctioning, but I think it'd be an overkill here, and perhaps there is a better way to check what httpd processes were doing and how long did it take them.
My issue looks very similar to the one described (and not solved) here: http://www.webhostingtalk.com/showthread.php?t=670621 In short, stracing a httpd process stops on LOCK_EX: $ strace -p 323006:57:12 open("/var/lib/php/session/sess_86ecf346c6f7adba93cb1077f6b95d43", O_RDWR|O_CREAT,
0600) = 44 06:57:12 flock(44, LOCK_EXAnd "lsof" shows that such session files are being accessed by many httpd processes (each wanting to have an exclusive lock, which will block all other instances).
Hmm, what should I do? -- Tomasz Chmielewski http://wpkg.org --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx