After switching pm from dynamic
to ondemand
I'm having less problems with memory usage on my 1GB VPS, but it seems that under some high load situations the server still gets stuck. It's an VMWare VPS with 1GB real RAM and 4GB 'fake RAM' (SSD Cache).
I installed newrelic server monitoring and realized that the problem still seems to be php5-fpm. The server goes up to a load of 150 (2 cpu system) and all php-fpm pools spawn their maximum of 10 children which eats up almost 2,5 GB RAM while the average RAM usage on the system is 300 MB.
If I understand ondemand
correctly, all the spare server settings are of no use and the spawned childs should die after the request is finished. So the only thing I could possibly do is to lower max_children
further, but because I have 30+ pools I guess this wouldn't help me either way.
This is my standard pool config:
[web2]
listen = 127.0.0.1:9011
listen.allowed_clients = 127.0.0.1
user = web2
group = client1
pm = ondemand
pm.max_children = 10
pm.process_idle_timeout = 10s;
pm.max_requests = 0
Has anybody an idea how to optimize this setup so the server doesn't get hang in high load situations?
******EDIT******
I tried process.max = 32
but I'm quite unsure if that is even changing something when using ondemand
. Server collapsed again today and I have no clue what the problem is. Totally moderate traffic. If I to a rush using blitz.io on a page everything goes smooth. He spawns all 10 children and delivers pages as fast as he can while delivering a immediate 500 to any more requests without making the server explode.
process.max
sounds like a nice solution, but doesn't seem to do any change. – s1lv3r Jun 20 '13 at 12:47