Fix the PHP-FPM Server Reached Max_children Error

php-fpm:  Fix the Max_children error

Occasionally, you may run into a max_children error with the PHP-FPM server:

[10-Dec-2018 04:30:31] WARNING: [pool example1] server reached max_children setting (5), consider raising it 

This can be fixed by typically making a change to the php-fpm.conf file, but you should also check for the other possible causes of that error. As PHP-FPM is a part of the UltraStack configuration, you will normally only see this error with that configuration in place (unless you have configured your server to use PHP-FPM). This article discusses the typical causes of this error and how to change the value within the configuration file.

Looking for a new home for your WordPress website? Look no further than InMotion Hosting’s WordPress Hosting solutions for secure, optimized servers that meet your budget needs.

Causes of the error

There can be a number of reasons that this error will occur. You should always check your server’s performance and resource usage to help prevent errors. The typical causes of this error include:

  • High traffic (concurrent visitors)
  • Bad scripts or code that leads to slow execution of PHP code
  • Low settings for the max_children setting in the PHP-FPM Config

As resource usage may often be the cause of this problem, make sure that your server has been properly optimized and tuned. A good guide for this topic is the WordPress Stack Optimization Guide: Tuning for VPS & Dedicated Servers.

Find Your CENTOS Version

Before you fix the value causing the error, you will need to first determine what version of CENTOS that you are running. This will help us give you the steps matching the interface that you’re seeing.

Look in the top right corner of WHM (where you should be logged in as ROOT).

Find your CENTOS version in the top right

Your version should be either 6.x or 7.x of CENTOS. Use the corresponding directions below to fix the error.

Fix Max_Children Error by Increasing the Value

In order to make changes to the configuration for PHP-FPM you will need to have at least a VPS subscription. This will allow you to access the Web Host Manager (WHM) which is used in this solution. You will also need a ROOT user login. Shared server resellers will need to submit a support ticket for changes to the configuration.

CENTOS 6x Instructions

  1. Login to WHM as Root.
  2. In the search field in the top left corner, type in MultiPHP Manager.
  3. You will see the option for MultiPHP Manager under Software. Click on it to proceed.
  4. Click on the System PHP-FPM Configuration tab.
  5. Increase Max children as needed. It starts at 5 by default.
  6. When you have completed adjusting the value for Max Children, make sure to scroll to the bottom of the screen and click on Save Configuration.
CENTOS 6.x version of the WHM interface to change the PHP-FPM Pool Options

CENTOS 7.x Instructions

  1. Log in to WHM as Root.
  2. In the search field in the top left corner, type in MultiPHP Manager.
  3. You will see the option for MultiPHP Manager under Software. Click on the icon or menu item to proceed.
  4. You will be on the MultiPHP Manager page. Make sure that PHP-FPM is enabled and then click on the Manage Settings button to the right.
    Multiphp Manager page - PHPFPM Settings
  5. You will then be on the System Settings tab, and you will see a title of System PHP-FPM Settings. Look for the Max children setting, then click on the number area where you will typically see a value of 5.

    System PHP-fpm settings in CENTOS 7
  6. Increase the value of the Max Children as needed.
  7. Once you have the value of Max Children set as needed, scroll to the bottom of the page and click on Update.

You can also find articles and guides on PHP-FPM in the InMotion Hosting Support website!

If you are unsure of the proper value, contact our live technical support team or submit a support ticket. For more information, see our other UltraStack tutorials.

Arnel Custodio Content Writer I

As a writer for InMotion Hosting, Arnel has always aimed to share helpful information and provide knowledge that will help solve problems and aid in achieving goals. He's also been active with WordPress local community groups and events since 2004.

More Articles by Arnel

Was this article helpful? Join the conversation!