Learn about Centmin Mod LEMP Stack today
Register Now

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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    4:57 AM
    Mainline
    10.2
    I have this setup working fine on 2 new server install.
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Thanks for the feedback. More feedback and testing from various folks will speed up it's inclusion into 123.09beta01 code base eventually :) :D
     
  4. wmtech

    wmtech Active Member

    173
    44
    28
    Jul 22, 2017
    Ratings:
    +129
    Local Time:
    9:57 PM
    We also have this installed at some machines and working without problems so far...
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Thanks for the confirmation :)
     
  6. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    10:57 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    What's the benefit of that?
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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"
    
     
  8. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    10:57 PM
    Nginx-1.25.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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    this :)
     
  10. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    10:57 PM
    Nginx-1.25.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......
     
  11. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    10:57 PM
    Nginx-1.25.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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  14. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    4:57 AM
    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

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  16. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    4:57 AM
    Mainline
    10.2
    What if?

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

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    then nothing to do :)
     
  18. rdan

    rdan Well-Known Member

    5,443
    1,402
    113
    May 25, 2014
    Ratings:
    +2,194
    Local Time:
    4:57 AM
    Mainline
    10.2
  19. eva2000

    eva2000 Administrator Staff Member

    54,107
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,738
    Local Time:
    6:57 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  20. iaTa

    iaTa Member

    43
    7
    8
    Mar 26, 2018
    Ratings:
    +9
    Local Time:
    8:57 PM
    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.