You're exhausting your child processes (pm.max_children) during the stress test and are queuing up the requests. Increase it if you've got memory to spare, otherwise you just have to be patient and let it drain the pipe.
@tchen said:
You're exhausting your child processes (pm.max_children) during the stress test and are queuing up the requests. Increase it if you've got memory to spare, otherwise you just have to be patient and let it drain the pipe.
Ok, but the CPU just stays around 100% and I can't access the website.
What do you use for stress testing? ab? How many requests/sec are you simulating? Be reasonable.
Anyways, it comes down to the fact that your wordpress pages are slow enough that they're causing back pressure on php-fpm. With only 5 child processes, a standard ab test will saturate the pipeline. Even if you stop ab, those requests are in the queue on the server and will have to be worked through hence why you keep seeing 100% cpu even when you 'stop' the test.
To figure out what a good php-fpm setting, you'll have to revisit how much load you expect first. Once you figure that out, then you can raise max_children so that it can satisfy those requests while not running out of memory.
@tchen said:
What do you use for stress testing? ab? How many requests/sec are you simulating? Be reasonable.
Anyways, it comes down to the fact that your wordpress pages are slow enough that they're causing back pressure on php-fpm. With only 5 child processes, a standard ab test will saturate the pipeline. Even if you stop ab, those requests are in the queue on the server and will have to be worked through hence why you keep seeing 100% cpu even when you 'stop' the test.
To figure out what a good php-fpm setting, you'll have to revisit how much load you expect first. Once you figure that out, then you can raise max_children so that it can satisfy those requests while not running out of memory.
Why not drop PHP-FPM? There are plenty other more actively developed and better maintained solutions and mediation strategies for high-traffic websites than PHP-FPM.
@BrianHarrison said:
Why not drop PHP-FPM? There are plenty other more actively developed and better maintained solutions and mediation strategies for high-traffic websites than PHP-FPM.
You mean you're suggesting something be used other than what's in PHP core?
@BrianHarrison said:
Why not drop PHP-FPM? There are plenty other more actively developed and better maintained solutions and mediation strategies for high-traffic websites than PHP-FPM.
Comments
How long does it say? Even after PHP script timeout?
Dunno, I quickly restart. But it would stay long if I leave it.
Please check your codes at first I think
Which code?
I run Nginx.
Should I reinstall PHP-FPM?
Here is the htop: http://i.imgur.com/IZaT1RW.png
PHP5-FPM Log: http://pastebin.com/PV8vgsEx
try again with a really simple php script, just an echo or something
that way you can tell if it's your code that's the problem
But I have all my files WordPress, this hasn't happened before, just when I reinstalled the server.
You're exhausting your child processes (pm.max_children) during the stress test and are queuing up the requests. Increase it if you've got memory to spare, otherwise you just have to be patient and let it drain the pipe.
Ok, but the CPU just stays around 100% and I can't access the website.
switch to apache
What Linux distribution do you use?
Debian 6 32bit
Should I?, I'm sure it needs more resources and there are security issues?
Please share your php5-fpm configuration.
nano /etc/php5/fpm/pool.d/www.conf
This is my low end configuration btw:
[www] user = www-data group = www-data listen = 127.0.0.1:9000; pm = dynamic pm.max_children = 1 pm.start_servers = 1 pm.min_spare_servers = 1 pm.max_spare_servers = 1 pm.max_requests = 128
Try changing it to dynamic.
pm = ondemand
->pm = dynamic
or increase pm.process_idle_timeout value maybe to 10 seconds.
Added ondemand and dynamic and restarted php-fpm.
I stress it goes to 100% and stays even though I stop the stress.
Something like this?
Yep I did that.
What do you use for stress testing? ab? How many requests/sec are you simulating? Be reasonable.
Anyways, it comes down to the fact that your wordpress pages are slow enough that they're causing back pressure on php-fpm. With only 5 child processes, a standard ab test will saturate the pipeline. Even if you stop ab, those requests are in the queue on the server and will have to be worked through hence why you keep seeing 100% cpu even when you 'stop' the test.
To figure out what a good php-fpm setting, you'll have to revisit how much load you expect first. Once you figure that out, then you can raise max_children so that it can satisfy those requests while not running out of memory.
Useful link:
http://myshell.co.uk/index.php/adjusting-child-processes-for-php-fpm-nginx/
LOIC, 20 threads. Even when I do it for 3 seconds it goes 100%
Why not drop PHP-FPM? There are plenty other more actively developed and better maintained solutions and mediation strategies for high-traffic websites than PHP-FPM.
You mean you're suggesting something be used other than what's in PHP core?
Could you name some please?
Try adding the ReallyStatic plugin to your blog. There's no way in fuck you're going to squeeze performance out of wordpress.
Do you think I should reinstall PHP-FPM?
Keep PHP-FPM for now. There's NOTHING BETTER for executing PHP.
And yes, I'm aware that is a very low standard.
How about your nginx configuration?