Changing PHP-FPM pool settings
Why?
When setting up and optimizing your site, it may be necessary to change the PHP-FPM pool parameters, such as pm.max_children
, pm.start_servers
and others.
Instructions
To change the pool parameters for a particular site, you need to edit the configuration file. Its location depends on the PHP version and operating system type:
For Ubuntu and Debian:
Native version
/etc/php/<your_version_php>/fpm/pool.d/pool.d/pool.d/<site_name>.conf
Example
/etc/php/7.4/fpm/pool.d/pool.d/pool.d/test.com.conf
Alternative version
/opt/<your_version_php>/etc/php-fpm.d/pool.d/<site_name>.conf
Example
/opt/php81/etc/php-fpm.d/pool.d/test.com.conf
For CentOS, AlmaLinux, RockyLinux, and CloudLinux:
Native version
/etc/php-fpm.d/pool.d/<site_name>.conf
Example
/etc/php-fpm.d/pool.d/test.com.conf
Alternative version
/opt/<your_version_php>/etc/php-fpm.d/pool.d/<site_name>.conf
Example
/opt/php71/etc/php-fpm.d/pool.d/test.com.conf
After changing the parameter, save the file and restart the «php-fpm» service with the appropriate version:
For Ubuntu and Debian:
Native version
systemctl restart php<your_version_php>-fpm.service
Example
systemctl restart php7.4-fpm.service
Alternative version
systemctl restart php-fpm<your_version_php>-version.service
Example
systemctl restart php-fpm82.service
For CentOS, AlmaLinux, RockyLinux, and CloudLinux:
Native version
systemctl restart php-fpm.service
Alternate version
systemctl restart php-fpm<your_version_php>.service
Example
systemctl restart php-fpm82.service
If you want to override the default settings, you can modify the panel configuration file template /usr/local/mgr5/etc/templates/fpm_site_pool.conf
.
Changes made to this configuration file will be applied to new PHP-FPM sites. To apply changes to existing ones, you need to switch their PHP mode or its version.
Switching versions or changing the handler affects the Nginx and Apache configuration files from the site, so it can affect the operation of the site, even causing it to fail.