nginx php-fpm configuration hitting children limit nginx php-fpm configuration hitting children limit nginx nginx

nginx php-fpm configuration hitting children limit


You may not only take in account the memory usage of PHP but also the concurrent CPU usage.

If you have too many child servers, it will only make things worse and slower and PHP can't handle any more of the requests, it can totally block everything.

Your server has a little too much memory for only 2 vCPUs, or the other way, it should have more CPU to fit to the amount of memory.

This is more appropriate for 2 virtual cpu cores:

pm = dynamicpm.max_children = 4pm.start_servers = 2pm.min_spare_servers = 1pm.max_spare_servers = 2pm.max_requests = 500

Also when you do 50 concurrent requests with Apache's Benchmark tool, it is totally normal for only 2 vCPU server to be very slow. Benchmarks should be ran from a different computer.

Keep in mind that the basic OS and your webserver (nginx) also needs some CPU usage.

Your AWS server has about the same power as a RaspberryPi with a little more memory.

Useful comment from Mjh:

100 requests a second isn't bad, if you get to a point where you have that much - that's a great problem to have. Dropping SSL in favor for requests per seconds might not be the best thing to do at this point. Of course, I don't know anything about your site and what you use it for, or whether SSL is needed or not, but having SSL does have an impact on your google ranking. It's always min-maxing, and in case of SSL, if I were you, I'd keep it.