Website is working slowly on PHP-FPM: server reached max_children setting or Bad file descriptor (9)

Created:

2016-12-12 03:46:16 UTC

Modified:

2017-08-16 17:35:52 UTC

8

Was this article helpful?


Have more questions?

Submit a request

Website is working slowly on PHP-FPM: server reached max_children setting or Bad file descriptor (9)

Applicable to:

  • Plesk for Linux

Symptoms

  • PHP handler FPM application server by Apache or FPM application server by nginx is selected in website PHP Settings .

  • The following message can be found in PHP-FPM error log ( /var/log/phpX-fpm.log or /var/log/plesk-phpXX-fpm/error.log , where X is a PHP version):

    WARNING: [pool example.com] server reached max_children setting (5), consider raising it
    ERROR: unable to read what child say: Bad file descriptor (9)
  • Website is not accessible with 503 Service Temporarily Unavailable or 502 Bad Gateway error.

Cause

The limit of pm.max_children (PHP-FPM pool parameter) has been reached.

Resolution

  1. Create the file php.ini at /var/www/vhosts/system/example.com/conf/

  2. Open the file php.ini in a text editor and add the following records:

    [php-fpm-pool-settings]
    pm.max_children = 40
  3. Update PHP settings to apply the changes:

    # /usr/local/psa/bin/php_settings -u

  4. If the issue persists, increase the value of pm.max_children to a greater value.

    The list of affected domains can be retrieved using the expression below:

    # grep "server reached max_children setting" /var/log/php-fpm/error.log | awk '{print $5}' | sort -n | uniq -c

Additional Information:

How to apply PHP-FPM pool settings for all the domains?

Have more questions? Submit a request

1 Comments

Please sign in to leave a comment.