Join the community today
Register Now

Master Branch update PHP-FPM config default templates etc in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Sep 16, 2020 at 8:42 AM.

  1. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    6:51 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    update PHP-FPM config default templates etc in 123.09beta01

    - Below updates are only for new 123.09beta01 installs so as to not overwrite customisations made by users. Existing users can manually edit global section of /usr/local/etc/php-fpm.conf, /usr/local/nginx/conf/php.conf and /usr/local/nginx/conf/default_phpupstream.conf and manually setup /usr/local/nginx/conf/phpfpmd/phpfpm_pool1_uds.conf file and then restart nginx and php-fpm
    - Update template used for /usr/local/etc/php-fpm.conf to raise global php-fpm values for emergency_restart_threshold and process_control_timeout from 10 and 10s to 100 and 185s respectively. .

    emergency_restart_threshold = 100
    emergency_restart_interval = 1m
    process_control_timeout = 185s

    - Update template used for /usr/local/nginx/conf/php.conf to raise fastcgi_connect_timeout, fastcgi_send_timeout and fastcgi_read_timeout value to 360 and disable via comment out with hash # in front of fastcgi_keep_conn directive to disable persistent php-fpm connections for less throughput but higher concurrent load handling

    #fastcgi_keep_conn on;
    fastcgi_connect_timeout 360;
    fastcgi_send_timeout 360;
    fastcgi_read_timeout 360;

    - Update template used for /usr/local/nginx/conf/default_phpupstream.conf default PHP-FPM upstream named dft_php. Set dftphp_zone buffer to 256K. Note keepalive doesn't take effect as fastcgi_keep_conn is now disabled/commented out by default

    Updated /usr/local/nginx/conf/default_phpupstream.conf looks like this now

    upstream dft_php {
    zone dftphp_zone 256k;
    keepalive 2;

    - Add a PHP-FPM unix socket pool for /var/run/php-fpm/php-fpm-pool1-uds.sock that can be optionally used at /usr/local/nginx/conf/phpfpmd/phpfpm_pool1_uds.conf when in /usr/local/etc/php-fpm.conf you uncomment include like and remove semi-colon.





    Existing 123.09beta01 users will need to update via cmupdate command and then copy /usr/local/src/centminmod/config/nginx/phpfpmd/phpfpm_pool1_uds.conf to /usr/local/nginx/conf/phpfpmd/phpfpm_pool1_uds.conf and restart nginx and php-fpm services

    Then you can update and switch from TCP to unix socket PHP-FPM by editing /usr/local/nginx/conf/default_phpupstream.conf to below

    upstream dft_php {
    zone dftphp_zone 256k;
    server unix:/var/run/php-fpm/php-fpm-pool1-uds.sock;
    keepalive 2;

    It's recommended to use TCP by default instead of PHP-FPM unix socket where possible but you can experiment for yourself

    Continue reading...

    Centmin Mod Github Master branch

    Master branch is where most recent commits are made as at May 24, 2015.