Get the most out of your Centmin Mod LEMP stack
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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    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
     
    • Like Like x 1
  2. RoldanLT

    RoldanLT Well-Known Member

    3,901
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    8:32 PM
    1.11
    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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    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 :)
     
    • Like Like x 1
  4. RoldanLT

    RoldanLT Well-Known Member

    3,901
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    8:32 PM
    1.11
    10.2
    I like to do it manually, that way I also learn :)
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
  6. RoldanLT

    RoldanLT Well-Known Member

    3,901
    949
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,298
    Local Time:
    8:32 PM
    1.11
    10.2
    Any proper guide to enable this pools and set as upstream server in nginx?
     
  7. eva2000

    eva2000 Administrator Staff Member

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 2
  8. pamamolf

    pamamolf Well-Known Member

    2,722
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:32 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    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/
     
    • Like Like x 1
  10. eva2000

    eva2000 Administrator Staff Member

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
  11. pamamolf

    pamamolf Well-Known Member

    2,722
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:32 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    yes only if you setup php.conf to use the specified backend in fastcgi_pass
     
    • Like Like x 1
  13. pamamolf

    pamamolf Well-Known Member

    2,722
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:32 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    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.

     
    • Like Like x 1
  15. pamamolf

    pamamolf Well-Known Member

    2,722
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:32 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    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 Well-Known Member

    2,722
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:32 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    it is load balancing.. that's what Nginx upstream feature is for :)
     
    • Like Like x 1
  19. pamamolf

    pamamolf Well-Known Member

    2,722
    242
    63
    May 31, 2014
    Ratings:
    +433
    Local Time:
    3:32 PM
    Nginx-1.13.x
    MariaDB 10.1.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

    30,163
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    10:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    ah yes forgot about those.. will add them :)
     
    • Like Like x 1