Join the community today
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. pamamolf

    pamamolf Premium Member Premium Member

    3,842
    377
    83
    May 31, 2014
    Ratings:
    +722
    Local Time:
    6:08 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    When you add them just let us know the shortcuts that we must use :)
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  3. pamamolf

    pamamolf Premium Member Premium Member

    3,842
    377
    83
    May 31, 2014
    Ratings:
    +722
    Local Time:
    6:08 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    ok take your time and i will test it when you finish it :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  5. pamamolf

    pamamolf Premium Member Premium Member

    3,842
    377
    83
    May 31, 2014
    Ratings:
    +722
    Local Time:
    6:08 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    [​IMG]

    Looks disabled :(

    For which cache is this and how can i enable it so i can benefit from it?
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    fastcgi_cache and proxy_cache if you configured it yourself
     
  7. pamamolf

    pamamolf Premium Member Premium Member

    3,842
    377
    83
    May 31, 2014
    Ratings:
    +722
    Local Time:
    6:08 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    I am using the default settings for those so don't have an idea about them...

    Do you recommend me to enable them and how can i do it?

    Thanks

    Also another typo php-poolx.conf :

    Code:
    # might shave 200+ ms off PHP requests
    It should be save and not shave :)
     
    Last edited: Jun 27, 2015
  8. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    I think shave is fine and correct term.
     
  9. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    shave = save.. both mean to reduce :D

    they need to be configured yourself so not as simple as enabling, so something you need to figure out yourself :)
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    3,842
    377
    83
    May 31, 2014
    Ratings:
    +722
    Local Time:
    6:08 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Code:
    shave = save
    Ok then sorry for my bad english :)
     
  11. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    I just tried the upstream multiple pools.
    And it slow my my sites :/
    I only have the 12 CPU core on Linode.
     
  12. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Depends on how each individual php-fpm pool and upstream is configured - default pool2 to pool5 have low max_children ~4 and other fpm values so need to tweak
     
  13. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    I modified them all, to use this value:
    I even created 2 more php-fpm pool, total of 8 pools.
    I'm also using Unix Socket, same as on nginx upstream declaration.

    It works fine for low traffic, but after a few minutes when traffic is coming it started to slow.
    I even tried rebuilding some attachment to test the performance, and it really slow's the entire site.

    I have 2 upstream by the way, with each upstream having 4 pools.
    One upstreams is on heavy traffic WP site and other one upstream for my forum.
     
  14. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    Right now, I'm only using 1 PHP-FPM pool with this config:
    And it's really fast.
    Still on Unix Socket and fastcgi_cache :)
     
  15. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Troubleshooting is left up to end user to do but here's a thread for starters to enable php status page output outlined at PHP PHP-FPM - Centmin Mod - Menu based Nginx installer for CentOS servers and also outlined at Beta Branch - Centmin Mod .08 beta03+ Multiple PHP-FPM pools support added | Centmin Mod Community You'll also need to check into your PHP-FPM, Nginx and MariaDB logs which you can find as outlined at How to troubleshoot Centmin Mod initial install issues.

    But most likely is is your traffic concurrency is hitting each individual php-fpm pool's max_children quickly - if you watch your php-fpm status statistics you should see. Also unix sockets don't handle high traffic well compared to TCP defaults ;)
     
  16. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    Without Multiple PHP-FPM Pool, and just using single pool still using Unix Socket works really fine for me.
    No problem at all.

    The WP site has 5k to 8k at peak times.
     
  17. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    I think having multiple pool is just not that ideal for single server with high traffic site hosted.
    Either each pool will die with low children configured
    OR
    if having more children configure on each poll will performs very slow as it will compete for CPU.
     
  18. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yeah still need to tweak and tune.. - multiple php-fpm pools isn't a magic bullet for better php performance :) and multiple php-fpm pools do not necessarily need to be used in upstream load balanced config :)
     
  19. rdan

    rdan Well-Known Member

    4,983
    1,185
    113
    May 25, 2014
    Ratings:
    +1,804
    Local Time:
    11:08 AM
    Mainline
    10.2
    For now, I think PHP LSAPI will perform more than multiple pools.
     
  20. eva2000

    eva2000 Administrator Staff Member

    45,155
    10,272
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,919
    Local Time:
    1:08 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yes it will for OpenLiteSpeed/LiteSpeed LSAPI PHP