Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Help interpreting user processes with php-fpm

Discussion in 'EasyApache' started by Metro2, Dec 21, 2018.

Tags:
  1. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    433
    Likes Received:
    32
    Trophy Points:
    178
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Really hoping for some less cryptic insight here than I'm finding on my own. After many years of running with suPHP handler, I recently bit the bullet and decided to switch to PHP-FPM and I'm having trouble identifying the specifics of user account processes in reports like "top" and "lfd" reports.

    TOP

    Example of a user process in top before switching from suPHP to PHP-FPM:

    Code:
    /opt/cpanel/ea-php72/root/usr/bin/php-cgi /home/example/public_html/wp-cron.php
    Example of same user in top now after switching to PHP-FPM:

    Code:
    php-fpm: pool example_com
    Obviously the former gives quick easy identification of exactly which process / script within the user's account is occurring, whereas the latter seems to be just sort of a generic "catch all" without specifics for tracking something down.

    LFD NOTICES:

    Example of a lfd excessive resource usage notice before switching from suPHP to PHP-FPM:

    Code:
    Excessive resource usage: example
    Time:         Fri Dec 14 19:56:06 2018 -0500
    Account:      example
    Resource:     Process Time
    Exceeded:     9054 > 1800 (seconds)
    Executable:   /opt/cpanel/ea-php72/root/usr/bin/php-cgi
    Command Line: /opt/cpanel/ea-php72/root/usr/bin/php-cgi /home/example/public_html/wordpress/index.php
    PID:          2995625 (Parent PID:2896911)
    Killed:       No
    Example of a lfd excessive resource usage notice now after switching from suPHP to PHP-FPM:

    Code:
    Excessive resource usage: example
    Time:         Fri Dec 21 05:12:03 2018 -0500
    Account:      example
    Resource:     Process Time
    Exceeded:     9050 > 1800 (seconds)
    Executable:   /opt/cpanel/ea-php72/root/usr/sbin/php-fpm
    Command Line: php-fpm: pool example_com                         
    PID:          2810258 (Parent PID:2359669)
    Killed:       No
    Again, the info provided when I was running suPHP handler really shows the exact script / operation within the user's account, making it very easy to identify specific source of the process, while the notices after switching to PHP-FPM just shows a sort of generic info.

    Surely there must be a way to identify more specific info with PHP-FPM like I was able to quickly / easily see when I was using suPHP handler, but I'm not having much luck finding out how in searches around the usual places. Maybe I'm just not using proper terminology in my searches.

    Could someone please let me know if there's a quick efficient way to get that same valuable specific info like I was able to before switching to PHP-FPM?

    I'd be grateful for any tips or guidance that could help as I venture into this new (to me) territory. Thanks for any responses!
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,891
    Likes Received:
    150
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    Unfortunately, this is the way PHP-FPM works. It's not the same as PHP as CGI (suphp).

    When your webserver requests a PHP script, it gets passed along to a PHP-FPM server (pool... socket).

    That is technically all the Linux kernel will see. That PHP-FPM socket is handling the PHP process. It is not privvy to what that socket is actually doing or what file(s) it is running.

    You can tail the domlogs for the particular user or virtualhost of the PHP-FPM socket to see what might be being accessed if you see a long running and high usage PHP-FPM process in top. But there's not going to be a way for the kernel to know what files a PHP-FPM socket is accessing.
     
    cPanelMichael and Metro2 like this.
  3. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    433
    Likes Received:
    32
    Trophy Points:
    178
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    @sparek-3 Thank you for taking time to reply and clarify that, I truly appreciate it!
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @Metro2,

    To reiterate, @sparek-3 is correct. The functionality you are seeking is exclusive to suPHP with the "full_php_process_display" setting in the /etc/suphp.conf file. It's not a feature of PHP-FPM.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Metro2 likes this.
  5. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    433
    Likes Received:
    32
    Trophy Points:
    178
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Thank you @cPanelMichael , always good to have that extra confirmation and a little info about the differences in how they work behind the scenes.
     
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice