I'm having this problem with nginx + php7.0-fpm.
Testing is done on a pure php server with no other services installed.
I'm getting the following warning.
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 35 total children
And it slows the server down greatly.
I'm using AWS t2.medium instance
- 2vCPU and 4GB RAM.
My php7.0-fpm/www.conf
set up looks like
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 20
pm.max_requests = 500
I have a laravel application that I'm using to test which simply replies {"m":"OK"}
to requests.
I tested that using apache2-utils
ab -n 1000 -c 50 https://mytestserver.com/
Response from ab
test -> https://ghostbin.com/paste/528tw
And I watch the CPU usage using htop
.
The two CPU usages hit 100% quickly during ab
test. However, Memory usage is only 400MB
.
Why is it using CPU too much? What do I do to make getting WARNING from php-fpm?
What am I doing wrong? Please guide me through.
Thanks.