PHP FPM pool configuration

Hello, hope you are well,

I want to ask to those who have experience with php-fpm if I am thinking well the following 2 cases to configure a pool in php-fpm:

First scenario: to configure a pool for a particular site (“site_1.com” belonging to user “user1”) I follow these steps:

  1. In the directory “/etc/php/X.X/fpm/fpm/pool.d/” I create a file with the name “site_1.com.conf” (if I understood well how Hestia works, the file name must be the domain name and not an arbitrary name right?)
    And inside the file:
[site_1.com]
listen = /run/php/phpX.X-fpm-site_1.com.sock
listen.owner = www-data
listen.group = www-data

user = user1
group = user1

pm = ondemand
pm.max_children = 
etc
etc
  1. I have been looking at the Hestia bash files and if I understand correctly, Hestia will populate the “fastcgi_pass” parameter with the correct value “unix:/run/php/php7.3-fpm-site_1.com.sock;” in the nginx template without the need to do it manually, correct?

Second scenario: if I want to configure or change the default pool values for all sites on a server it is only necessary to edit “www.conf” (in “/etc/php/X.X/fpm/pool.d/”) and then just do a restart of php fpm, correct? or is it necessary to make some other changes somewhere else?

Thanks in advance for any corrections !

No create a custom template:

And make sure it is named:
YOURNAME-PHP-8_1.tpl

Where 8_1 is the php version

Then change the template in Edit Web domain

  1. I have been looking at the Hestia bash files and if I understand correctly, Hestia will populate the “fastcgi_pass” parameter with the correct value “unix:/run/php/php7.3-fpm-site_1.com.sock;” in the nginx template without the need to do it manually, correct?

Only if you make the changes to the template and not make the file your self they will get overwritten as explained in any template…

Second scenario: if I want to configure or change the default pool values for all sites on a server it is only necessary to edit “www.conf” (in “/etc/php/X.X/fpm/pool.d/”) and then just do a restart of php fpm, correct? or is it necessary to make some other changes somewhere else?

Yes this is the only way… Make sure there can only 1 exists …

1 Like

Thank you Eris !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.