Question

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.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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