Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED PHP-FPM pm dynamic / static / ondemand option

Discussion in 'EasyApache' started by unity200, May 21, 2019.

Tags:
  1. unity200

    unity200 Member

    Joined:
    Nov 16, 2006
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    153
    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

    • /var/cpanel/ApachePHPFPM/system.yaml
    • /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
    However they dont exist in my system? Do i create them and put my settings in? Which one? Do i use the syntax which php-fpm.conf uses, if not, which syntax do i use? yaml syntax?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,910
    Likes Received:
    484
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelMichael likes this.
  3. unity200

    unity200 Member

    Joined:
    Nov 16, 2006
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    153
    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.
     
    Infopro likes this.
  4. unity200

    unity200 Member

    Joined:
    Nov 16, 2006
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    153
    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?
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,334
    Likes Received:
    2,162
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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?

    SOLVED - How-To Modify PHP-FPM Configuration Directives in EasyApache 4

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. unity200

    unity200 Member

    Joined:
    Nov 16, 2006
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    153
    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.
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,334
    Likes Received:
    2,162
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @unity200,

    To modify the value for a PHP-FPM configuration directive, it's important to first browse to the following document and search for the name of the directive you want to modify:

    Configuration 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:

    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. unity200

    unity200 Member

    Joined:
    Nov 16, 2006
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    153
    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.
     
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,334
    Likes Received:
    2,162
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @unity200,

    Ensure you execute the following commands after making the change to /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml:

    Code:
    /usr/local/cpanel/scripts/php_fpm_config --rebuild
    /scripts/restartsrv_httpd
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice