PHP-FPM pm dynamic / static / ondemand option
I had to create this thread since the forum didnt let me post in a one year old thread which deals with the exact same issue. So, here goes:
I want to change the pm setting and set it to static. However i am not able to determine the proper way to do it.
Above post refers to the below page PHP-FPM Code and FileSystem Layout for EasyApache 4 - Version 68 Documentation - cPanel Documentation And a non-applicable guide from a forum post in which someone upgraded their easyapache 3 to easyapache 4 and fpm. ............... Do i have to put my dynamic/static choice in /opt/cpanel/ea-phpXX/root/etc/php-fpm.conf for each PHP version per that doc page? In those files it says that these files are auto generated - which means they would be overwritten? In the doc it talks about below yaml files
Hello, The information in the previous post should help. Let us know if you have additional questions. Thank you.
Above post refers to the below page PHP-FPM Code and FileSystem Layout for EasyApache 4 - Version 68 Documentation - cPanel Documentation And a non-applicable guide from a forum post in which someone upgraded their easyapache 3 to easyapache 4 and fpm. ............... Do i have to put my dynamic/static choice in /opt/cpanel/ea-phpXX/root/etc/php-fpm.conf for each PHP version per that doc page? In those files it says that these files are auto generated - which means they would be overwritten? In the doc it talks about below yaml files
- /var/cpanel/ApachePHPFPM/system.yaml
- /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
-
I saved the values in /var/cpanel/ApachePHPFPM/system.yaml pm: static pm.max_children: 400 and used /scripts/php_fpm_config --rebuild and it worked. Thanks. 0 -
Doing the exact same operation on another server, now im getting ERROR: [/opt/cpanel/ea-php72/root/etc/php-fpm.conf:47] unknown entry 'pm' It seems now somehow pm entry is not recognized despite it was recognized before. Can anyone shed some light on this? 0 -
Doing the exact same operation on another server, now im getting ERROR: [/opt/cpanel/ea-php72/root/etc/php-fpm.conf:47] unknown entry 'pm' It seems now somehow pm entry is not recognized despite it was recognized before. Can anyone shed some light on this?
Hello @unity200, Can you share the step-by-step instructions of the changes you made and the specific entries you added or modified? Did you follow the guide linked on the thread below? Thank you.0 -
Yes, i followed that guide and it doesnt work. When i removed those values from /var/cpanel/ApachePHPFPM/system.yaml and instead put them in /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml it seems to have worked. But of course, i cant be sure. I am seeing a higher number of php-fpm processes in ps -aux | grep php*, so i think it may have worked. If someone can confirm that i would appreciate it. 0 -
I saved the values in /var/cpanel/ApachePHPFPM/system.yaml pm: static pm.max_children: 400
When i removed those values from /var/cpanel/ApachePHPFPM/system.yaml and instead put them in /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml it seems to have worked.
Hello @unity200, To modify the value for a PHP-FPM configuration directive, it's important to first browse to the followingConfiguration Values of PHP-FPM - Version 80 Documentation - cPanel Documentation As seen on the document linked above, "pm" and "pm.max_children" are found under the Pool name directives section. Directives listed under the Pool name directives section are known as Pool directives. Thus, you'd customize the directive in the file path listed under the following section of the thread linked in my last response: [QUOTE]Pool Directives Defaults: /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml Individual Domains: /var/cpanel/userdata/$username/$domain.tld.php-fpm.yaml
In this case, since you're making a change to the default value, you'd add the custom value to /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml. Let me know if this helps. Thank you.0 -
Per your post above: - I made changes to the default value. This didnt change the amount of processes one particular site user can spawn. Despite it seems to increase the total amount of spawned processes by php-fpm. - When i changed the individual values for children for that site account in php-fpm config for that account in MultiPHP manager in WHM, that allowed more php processes for the user. So it seems changing default values after a user is created has no effect. Individual values from MultiPHP php-fpm configuration must be changed per domain if a user already exists. I think we can consider this solved. Thanks. 0 -
So it seems changing default values after a user is created has no effect. Individual values from MultiPHP php-fpm configuration must be changed per domain if a user already exists.
Hello @unity200, Ensure you execute the following commands after making the change to /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml:/usr/local/cpanel/scripts/php_fpm_config --rebuild /scripts/restartsrv_httpd
Thank you.0 -
Hi the discussion on this page sees to contradict others I"ve read which says put pm: static in this fike /var/cpanel/userdata/username/domain.tld.php-fpm.yaml Which is correct? 0 -
- @uk01 - the details here are 3 years old, and we've made changes to the PHP-FPM system in that time. You can always find the latest details in our documentation here:
which does contain the /var/cpanel/userdata/username/domain.tld.php-fpm.yaml path that you mention.0 -
"@uk01 - the details here are 3 years old, and we've made changes to the PHP-FPM system in that time. You can always find the latest details in our documentation here:"
Hello where is the link to see the latest details to make such changes?
0 -
CharlesGLondon - I've updated the older post so it has the link - let me know if that has what you need.
0 -
Yes, I already found it from searching. Thanks.
0
Please sign in to leave a comment.
Comments
13 comments