I have a real head scratcher with one site on a server affecting others in separate php-fpm pools. I thought the idea was that php-fpm pools gave isolation to stop (reduce) this from happening.

We have a typical LEMP server (Ubuntu 16.04 running NGINX with both php-fpm 7.0 and 5.6. MySQL is on another box.) running a number of sites of various sizes.

To clarify, this does not appear to be a server resource issue; CPU, memory, inodes, open files, networking, we have checked everything we can think of and still have plenty of headroom on the server.

The pools however are limited in resource...


user = siteone
group = siteone
listen = /var/run/php5.6-fpm-siteone.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 25
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
php_admin_value[error_log] = /var/log/php-fpm/siteone/siteone-php-fpm.log
php_value[newrelic.appname] = "siteone - LIVE"
php_admin_value[upload_max_filesize] = 5M
request_terminate_timeout = 5m
pm.max_requests = 5000

Yet when one site hits maxchildren all the sites start timing out.

Any advice please.

Thank you in advance.

  • Are you certain you've got pools and not just one shared pool? You do have to specifically set up each individual pool - the default config will give you just one that all sites use. – ceejayoz Sep 18 '18 at 14:50
  • Very certain we have a separate pool for each site :-) – Dogsbody Sep 18 '18 at 14:52
  • You're certain they're being used as you expect? What sort of behavior do you see when one of the sites hits the limits? (Sorry, we get enough "oh that was silly of me" issues around here I'm trying to clear out the basics.) – ceejayoz Sep 18 '18 at 15:01
  • 1
    Totally understand, three of us have looked at this now so not expecting that. Each site has it's own socket which just wouldn't even work if they were set wrong as the site files would be owned by the wrong user. I've updated the OP with the full pool config. When this happens one site hits maxchildren and all the sites start timing out. – Dogsbody Sep 18 '18 at 15:11
  • 3
    If you enable the php-fpm status page with an nginx config passing to it locked down to allow; deny all;. Talking to this locally (e.g. with curl) will give you some statistics on the listen queue. If the listen queue gets too full it will start rejecting connections and nginx will show a 502/504 response. You can tune the php-fpm config value listen_backlog to increase the queue. You might have to tweak some kernel variables too. – jedifans Oct 10 '18 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.