How to change PHP-FPM pool settings for a domain in Plesk

Follow

Comments

13 comments

  • Avatar
    Oliver Burkill

    In /opt/plesk/php/7.0/etc/php-fpm.d/<domain>.conf It says "; Following options can be overridden", however it seems they can't and do get overwritten by Plesk meaning this method is needed.

    In this article I think the two images for Plesk and OS provided PHP are the wrong way round.

  • Avatar
    Nikolay Zhmuk

    Hi

    > In /opt/plesk/php/7.0/etc/php-fpm.d/<domain>.conf It says "; Following options can be overridden", however it seems they can't and do get overwritten by Plesk meaning this method is needed.

    "; Following options can be overridden" - this comment means that directives below can be overwritten in /var/www/vhosts/system/example.com/conf/php.ini config

    > In this article I think the two images for Plesk and OS provided PHP are the wrong way round.

    Thank you, the article has been updated

  • Avatar
    Sathish

    If i am using windows plesk onyx how to edit ?

  • Avatar
    Artyom Baranov

    Hello Sathish,

    > If i am using windows plesk onyx how to edit ?

    This article is not applicable for Plesk on Windows because PHP-FPM handler is only available for Plesk on Linux:

    https://docs.plesk.com/en-US/onyx/administrator-guide/web-hosting/php-management/php-handler-types.75145/

  • Avatar
    Peter Debik

    The script that creates the php.ini file creates that file, but it does not apply the new settings. It is still necessary to click the "Apply" button in the subscription to reconfigure the php init file of the affected domain for the new default settings to take effect.

    Can that be automated, too, e.g. by adding another event that reconfigures PHP for the newly created domain only AFTER the subscription or add-on domain was created? How?

  • Avatar
    Konstantin Annikov

    Hi Peter,

    Script was updated, thank you for bringing our attention. 

  • Avatar
    Peter Debik

    Great. Thank you! Just one minor addition please: The "/usr/local/psa/bin/domain" command needs to start in a new line, then everything is perfect.

  • Avatar
    Muhammad Hassaan

    I am still getting the following error :(

     

    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'pm'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'pm.start_servers'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'pm.max_children'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'pm.max_requests'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'pm.min_spare_servers'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'pm.max_spare_servers'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] child 22843 said into stderr: "ERROR: Unable to set php_value 'listen.backlog'"
    [29-May-2017 16:59:17] WARNING: [pool instahd.info] server reached max_children setting (5), consider raising it

     

    The above solution not working on CentOS 7.3 anymore.

  • Avatar
    Muhammad Hassaan

    Latest logs

     

    [29-May-2017 17:22:16] WARNING: [pool instahd.info] child 29821 said into stderr: "ERROR: Unable to set php_value 'pm.max_children'"
    [29-May-2017 17:22:16] WARNING: [pool instahd.info] child 29821 said into stderr: "ERROR: Unable to set php_value 'pm.max_requests'"
    [29-May-2017 17:22:16] WARNING: [pool instahd.info] child 29824 said into stderr: "ERROR: Unable to set php_value 'pm.max_children'"
    [29-May-2017 17:22:16] WARNING: [pool instahd.info] child 29824 said into stderr: "ERROR: Unable to set php_value 'pm.max_requests'"
    [29-May-2017 17:22:16] WARNING: [pool instahd.info] server reached max_children setting (5), consider raising it

     

     

  • Avatar
    Vitaly Zhidkov

    @Muhammad, please post the content of /var/www/vhosts/system/example.com/conf/php.ini

  • Avatar
    Muhammad Hassaan

    @Vitaly my settings are following

     

    listen.backlog = 65535

    ;[php-fpm-pool-settings]
    pm = dynamic
    pm.max_children = 5000
    pm.start_servers = 50
    pm.min_spare_servers = 20
    pm.max_spare_servers = 70
    pm.max_requests = 2000

     

    I have 64GB of Ram

  • Avatar
    Vitaly Zhidkov

    @Muhammad, try to remove semicolon before [php-fpm-pool-settings] section and run the following command:

    # /usr/local/psa/bin/php_settings -u

  • Avatar
    Muhammad Hassaan

    @Vitaly thanks, that works

Please sign in to leave a comment.

Have more questions? Submit a request