Welcome to Centmin Mod Community
Register Now

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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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. rdan

    rdan Premium Member Premium Member

    4,420
    1,059
    113
    May 25, 2014
    Ratings:
    +1,543
    Local Time:
    4:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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. rdan

    rdan Premium Member Premium Member

    4,420
    1,059
    113
    May 25, 2014
    Ratings:
    +1,543
    Local Time:
    4:40 AM
    Mainline
    10.2
    I like to do it manually, that way I also learn :)
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  6. rdan

    rdan Premium Member Premium Member

    4,420
    1,059
    113
    May 25, 2014
    Ratings:
    +1,543
    Local Time:
    4:40 AM
    Mainline
    10.2
    Any proper guide to enable this pools and set as upstream server in nginx?
     
  7. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 2
  8. pamamolf

    pamamolf Well-Known Member

    3,119
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  11. pamamolf

    pamamolf Well-Known Member

    3,119
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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

    3,119
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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

    3,119
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    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

    3,119
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    it is load balancing.. that's what Nginx upstream feature is for :)
     
    • Like Like x 1
  19. pamamolf

    pamamolf Well-Known Member

    3,119
    295
    83
    May 31, 2014
    Ratings:
    +531
    Local Time:
    10:40 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

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    6:40 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    ah yes forgot about those.. will add them :)
     
    • Like Like x 1
..