Websites slow after restarting NGINX and php7.0-pfm

We had to restart nginx and php7.0-fpm on our droplet (Ubuntu 16.04) because it was throwing back 502 errors on all our sites. Now the sites are running slowly. When I restart the services again, they speed up briefly, only to slow down again. There isn’t an unusually high load on the droplet, and checking top doesn’t show any rogue processes.


How did you solve the problem? I hit the exactly same issue today.

I followed this link ( to increase the max_children. The situation is getting a little better.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If you are reaching the limit, I’ll recommend raising your max_children as well rather than just your max_requests.

The important settings is your max_children and it’s number. Basically, Max_children refers to the maximum number of concurrent PHP-FPM processes allowed to exist in such a pool. If the volume of incoming requests requires the creation of more PHP-FPM processes than the number allowed by the max_children limit, those additional requests are backlogged in a queue to await service.

Hi there @MSV,

I could suggest checking a few things:

  • Check your Nginx access log to see what requests are being handled by your web server during that time:
  1. sudo tail -f /var/log/nginx/access.log
  • Check your TCP connections:
  1. sudo netstat -plant
  • Try checking your processes with htop

Feel free to share the output of the commands here as well.

I believe that you might be hitting your worker connections limit for your Nginx webserver or the max requests for PHP FPM. You might have to tweak your Nginx and PHP FPM configuration files in order to increase that accordingly.

Regards, Bobby