Want to subscribe to topics you're interested in?
Become a Member

Beta Branch prep for PHP-FPM pools 2 to 5 support

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jun 25, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    prep for PHP-FPM pools 2 to 5 support

    on ports 9002,9003, 9004, 9005. disabled by default

    Continue reading...


    123.08beta03 branch

    * 123.08beta03 branch is the merging of the 3 branches - .08 beta 02 + 123.08lua + 123.08livestats so the new beta has both Nginx Lua + LuaJIT support + new Nginx vhost traffic statistics
     
  2. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    1:33 AM
    Mainline
    10.2
    So no need for the auto script you have for premium members :).
    Still I didn't tried it though.
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah well that's sort of the plan.. with the above you still need to do some manual work unlike the auto multiple php-fpm pool generator I have for Premium Members :)
     
  4. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    1:33 AM
    Mainline
    10.2
    I like to do it manually, that way I also learn :)
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  6. rdan

    rdan Well-Known Member

    5,446
    1,408
    113
    May 25, 2014
    Ratings:
    +2,201
    Local Time:
    1:33 AM
    Mainline
    10.2
    Any proper guide to enable this pools and set as upstream server in nginx?
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  8. pamamolf

    pamamolf Premium Member Premium Member

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    7:33 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    As i don't have those files do i have to reinstall latest php that i use now to get them?

    And one last question :)

    Which file i should edit to add the code:

    Code:
    upstream phpbackend {
    ip_hash;
    keepalive 5;
      server 127.0.0.1:9000 weight=50;
      server 127.0.0.1:9002 weight=50;
      server 127.0.0.1:9003 weight=50;
      server 127.0.0.1:9004 weight=50;
      server 127.0.0.1:9005 weight=50;
    }
    Is it the /usr/local/nginx/conf/nginx.conf ?
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes edit nginx.conf i updated the instructions at Beta Branch - Centmin Mod .08 beta03+ Multiple PHP-FPM pools support added | Centmin Mod Community

    need to update .08 beta03 latest code and copy them over to your existing Centmin Mod server locations

    Code:
    cp /usr/local/src/centminmod-123.08beta03/config/nginx/php-pool* /usr/local/nginx/conf/
    cp /usr/local/src/centminmod-123.08beta03/config/nginx/phpfpmd/phpfpm_pool* /usr/local/nginx/conf/phpfpmd/
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  11. pamamolf

    pamamolf Premium Member Premium Member

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    7:33 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    I can see on your example that you use pool 2 for admin directory.

    If i don't specify any path or any pool the requests will auto share/split to all pools automatically?
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes only if you setup php.conf to use the specified backend in fastcgi_pass
     
  13. pamamolf

    pamamolf Premium Member Premium Member

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    7:33 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Is there any easy way to log php tasks that taking to long or try to kill a pool by making a lot of requests or by running for a long time?
     
  14. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    php-fpm request_terminate_timeout, request_slowlog_timeout and slowlog in each php-fpm config file PHP: Configuration - Manual You're on your own for configuring that.

     
  15. pamamolf

    pamamolf Premium Member Premium Member

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    7:33 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    A small typo i think :)
    At all php-poolx.conf files:

    Code:
    # next 3 lines when uncommented / enabled
    # pallow Nginx to handle uploads which then 
    It should be allow and not pallow... :)

    Also if one pool reach max children/connections ... new connections will auto forward to another pool?
     
    Last edited: Jun 27, 2015
  16. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    fixed typos thanks.. if the max children is reached + that pool becomes unresponsive, then it should go to next pool in upstream i believe
     
  17. pamamolf

    pamamolf Premium Member Premium Member

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    7:33 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    That would be amazing if it works like this !!!!
    At the moment i can't test it and i hope someone can verify it :)
    It will be like load balancing !!!! Great !
     
  18. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it is load balancing.. that's what Nginx upstream feature is for :)
     
  19. pamamolf

    pamamolf Premium Member Premium Member

    4,084
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    7:33 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Just tested and works great ! :)

    What about adding shortcuts for edit pool 2,3,4,5 settings ? (like fpmconf that can edit main pool)

    Maybe something like:
    Code:
    fpmpool2
    or

    Code:
    fpmconf2
    Thanks George !!!!
     
  20. eva2000

    eva2000 Administrator Staff Member

    54,524
    12,211
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,780
    Local Time:
    3:33 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ah yes forgot about those.. will add them :)