Help interpreting user processes with php-fpm

Metro2

Well-Known Member
May 24, 2006
455
41
178
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!
 

sparek-3

Well-Known Member
Aug 10, 2002
1,929
178
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.