Join the community today
Become a Member

PHP-FPM Beta Branch CentOS 7.x CentOS 7 Proper PHP-FPM systemd service file

Discussion in 'Beta release code' started by eva2000, Jan 26, 2019.

  1. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    once more testing and user feedback from folks like yourself is done, then yes it will be added by default in 123.09beta01
     
  2. rdan

    rdan Well-Known Member

    4,549
    1,090
    113
    May 25, 2014
    Ratings:
    +1,591
    Local Time:
    3:11 PM
    Mainline
    10.2
    I have this setup working fine on 2 new server install.
     
    • Like Like x 1
  3. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Thanks for the feedback. More feedback and testing from various folks will speed up it's inclusion into 123.09beta01 code base eventually :) :D
     
    • Optimistic Optimistic x 1
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. wmtech

    wmtech Active Member

    111
    30
    28
    Jul 22, 2017
    Ratings:
    +83
    Local Time:
    9:11 AM
    We also have this installed at some machines and working without problems so far...
     
    • Like Like x 1
  5. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Thanks for the confirmation :)
     
  6. pamamolf

    pamamolf Premium Member Premium Member

    3,356
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    10:11 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    What's the benefit of that?
     
  7. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Access to PHP-FPM stats right from php-fpm service status and fpmstats commands
    Code (Text):
    fpmstats
    Processes active: 0, idle: 30, Requests: 241, slow: 0, Traffic: 0req/sec
    pool:                 www
    process manager:      static
    start time:           09/Feb/2019:01:59:34 +0000
    start since:          45423
    accepted conn:        243
    listen queue:         0
    max listen queue:     0
    listen queue len:     128
    idle processes:       29
    active processes:     1
    total processes:      30
    max active processes: 6
    max children reached: 0
    slow requests:        0
    

    Code (Text):
    fpmstatus
    * php-fpm.service - PHP FastCGI Process Manager
       Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/php-fpm.service.d
               `-limit.conf
       Active: active (running) since Sat 2019-02-09 01:59:34 UTC; 12h ago
     Main PID: 3361 (php-fpm)
       Status: "Processes active: 0, idle: 30, Requests: 243, slow: 0, Traffic: 0req/sec"
       CGroup: /system.slice/php-fpm.service
               |-3361 php-fpm: master process (/usr/local/etc/php-fpm.conf)                                                         
               |-3362 php-fpm: pool www                                                                                             
               |-3363 php-fpm: pool www                                                                                             
               |-3364 php-fpm: pool www                                                                                             
               |-3365 php-fpm: pool www                                                                                             
               |-3366 php-fpm: pool www                                                                                             
               |-3367 php-fpm: pool www                                                                                             
               |-3368 php-fpm: pool www                                                                                             
               |-3369 php-fpm: pool www                                                                                             
               |-3370 php-fpm: pool www                                                                                             
               |-3371 php-fpm: pool www                                                                                             
               |-3372 php-fpm: pool www                                                                                             
               |-3373 php-fpm: pool www                                                                                             
               |-3374 php-fpm: pool www                                                                                             
               |-3375 php-fpm: pool www                                                                                             
               |-3376 php-fpm: pool www                                                                                             
               |-3377 php-fpm: pool www                                                                                             
               |-3378 php-fpm: pool www                                                                                             
               |-3379 php-fpm: pool www                                                                                             
               |-3380 php-fpm: pool www                                                                                             
               |-3381 php-fpm: pool www                                                                                             
               |-3382 php-fpm: pool www                                                                                             
               |-3383 php-fpm: pool www                                                                                             
               |-3384 php-fpm: pool www                                                                                             
               |-3385 php-fpm: pool www                                                                                             
               |-3386 php-fpm: pool www                                                                                             
               |-3387 php-fpm: pool www                                                                                             
               |-3388 php-fpm: pool www                                                                                             
               |-3389 php-fpm: pool www                                                                                             
               |-3390 php-fpm: pool www                                                                                             
               `-3391 php-fpm: pool www                                                                                             
    
    Feb 09 01:59:34 hostname systemd[1]: Starting PHP FastCGI Process Manager...
    Feb 09 01:59:34 hostname systemd[1]: Started PHP FastCGI Process Manager.
    

    notice the line in status output
    Code (Text):
       Status: "Processes active: 0, idle: 30, Requests: 243, slow: 0, Traffic: 0req/sec"
    
     
    • Like Like x 1
  8. pamamolf

    pamamolf Premium Member Premium Member

    3,356
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    10:11 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Do i have to recompile/update first php from menu and then use:

    Code:
    curl -sL https://gist.githubusercontent.com/centminmod/a84a86775925ea558fece1f0ac130be3/raw/php-systemd.sh | bash -s fpm-systemd

    Or should i run the command first and then recompile/update php?
     
  9. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    this :)
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    3,356
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    10:11 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    For me running the command and then update to the new version didn't work.

    I had to run the command again and now is ok :)

    Not sure if i did all correct as i was following the topic and i was run:

    Code:
    curl -sL https://gist.githubusercontent.com/centminmod/a84a86775925ea558fece1f0ac130be3/raw/php-systemd.sh | bash
    and then:

    Code:
    curl -sL https://gist.githubusercontent.com/centminmod/a84a86775925ea558fece1f0ac130be3/raw/php-systemd.sh | bash -s fpm-systemd
    and then update php from menu......
     
    • Informative Informative x 1
  11. pamamolf

    pamamolf Premium Member Premium Member

    3,356
    318
    83
    May 31, 2014
    Ratings:
    +593
    Local Time:
    10:11 AM
    Nginx-1.17.x
    MariaDB 10.3.x
    Also using dynamic when i run fpmstats i can see only this:

    and not this as your example:

     
  12. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    yes dynamic and ondemand only show processes that are active unlike static which runs all php-fpm children even if not active
     
  13. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  14. rdan

    rdan Well-Known Member

    4,549
    1,090
    113
    May 25, 2014
    Ratings:
    +1,591
    Local Time:
    3:11 PM
    Mainline
    10.2
    Is this the same command I should run on old system if I want to migrate to systemd?
    Or just wanting to update my systemd file for php-fpm?
     
  15. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    when you run centmin.sh menu option 5 to update/recompile PHP for CentOS 7 - it will now default to php-fpm systemd on latest updated 123.09beta01
     
    • Informative Informative x 1
  16. rdan

    rdan Well-Known Member

    4,549
    1,090
    113
    May 25, 2014
    Ratings:
    +1,591
    Local Time:
    3:11 PM
    Mainline
    10.2
    What if?

    Old server using this since it was introduce on this thread.
     
  17. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    then nothing to do :)
     
    • Like Like x 1
  18. rdan

    rdan Well-Known Member

    4,549
    1,090
    113
    May 25, 2014
    Ratings:
    +1,591
    Local Time:
    3:11 PM
    Mainline
    10.2
  19. eva2000

    eva2000 Administrator Staff Member

    40,647
    9,028
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,900
    Local Time:
    5:11 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    i updated the url there to 123.09beta01 one so it's same as what's in 123.09beta01 but shouldn't be any harm and re-running
     
    • Winner Winner x 1
  20. iaTa

    iaTa Member

    32
    6
    8
    Mar 26, 2018
    Ratings:
    +6
    Local Time:
    8:11 AM
    Why does 'systemctl status php-fpm' usually state:
    Code:
    php-fpm.service: Supervising process ##### which is not our child. We'll most likely not notice when it exits.