Learn about Centmin Mod LEMP Stack today
Become a Member

Master Branch update php-fpm configuration in 123.09beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Feb 11, 2019.

  1. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    3:52 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    update php-fpm configuration in 123.09beta01

    1. update default pm.max_children value from 20 to 30 in PHP-FPM config file /usr/local/etc/php-fpm.conf for fresh installs only. Existing installs not changed as it may override existing install's custom settings users may have made.
    2. update nginx.conf add /usr/local/nginx/conf/default_phpupstream.conf in 123.09beta01

    add /usr/local/nginx/conf/default_phpupstream.conf include file to /usr/local/nginx/conf/nginx.conf which contains the new default PHP-FPM upstream configuration named dft_php containing


    upstream dft_php {
    zone dftphp_zone 128k;
    server 127.0.0.1:9000;
    keepalive 2;
    }

    The global php include file at /usr/local/nginx/conf/php.conf in every generated nginx vhost is responsible for serving PHP to visitors. In the /usr/local/nginx/conf/php.conf include file the setting

    fastcgi_pass 127.0.0.1:9000;

    is responsible for telling Nginx which PHP-FPM server to communicate with - the default PHP-FPM server is located on 127.0.0.1 port 9000.

    with newly added /usr/local/nginx/conf/default_phpupstream.conf include file to /usr/local/nginx/conf/nginx.conf in place, you can edit /usr/local/nginx/conf/php.conf to change the referenced fastcgi_pass setting to talk to a upstream called dft_php

    fastcgi_pass dft_php;
    #fastcgi_pass 127.0.0.1:9000;

    with old setting commented out with a hash # in front of it. New 123.09beta01 installs only will default to this configuration in /usr/local/nginx/conf/php.conf with added /usr/local/nginx/conf/default_phpupstream.conf include file in /usr/local/nginx/conf/nginx.conf. Existing installs will have added /usr/local/nginx/conf/default_phpupstream.conf include file in /usr/local/nginx/conf/nginx.conf but /usr/local/nginx/conf/php.conf include is not changed as it may override existing install's custom settings.

    dft_php upstream references the server that nginx will communicate with which is same default PHP-FPM 127.0.0.1 on port 9000 while upstream has additional settings for keepalive. Switching to such a setup might have slight benefit for PHP-FPM latency response times and performance.

    Continue reading...

    Centmin Mod Github Master branch

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