Solved How to see what script a php-fpm pool is providing?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
13,684
Location
Maastricht
We are experiencing a high load on 1 user, but I can't find out what exactly is causing it.
I do see a high cpu load on one user like:
php-fpm: pool foobar

So is there a way I can check what this php-fpm pool is providing, which script? I think I found something but that's for nGinx, not for apache.

I would love to be able to check this via console or some apache status page.

Any clue?
 
Thank you but unfortunately not. I have server-status and apache status active.
I had a look at that already before but it just shows lines like this:
2-0-0/0/1. 0.001279813389133890.00.000.05 95.xx.xx.xxhttp/1.1www.somedomain.nl:443GET /winkel/page/6/?add_to_wishlist=247&_wpnonce=04d1df96bc HTT
but not a whole lot of these lines.
In fact a lot less than another domain on the server, while that domain does not have a high cpu load.
So I thought maybe there was another way to see what specifically caused that high load via the php-fpm pool.
Indeed nGinx has a more nice feature for that.
 
Yes there have. but it need to add some customize.

this could do in "Custom HTTPD Configurations"

APACHE: pick one of domain to use as proxy request.
add something like this

#custom3
Code:
<LocationMatch "/fpm-status">
    Order Allow,Deny
    Allow from 127.0.0.1
    ProxyPass unix:/usr/local/php81/sockets/someuser.sock|fcgi://localhost/fpm-status
</LocationMatch>
php81 = PHP version
someuser = USER


in PHP-FPM,
#custom2
Code:
pm.status_path = /fpm-status


and save/reload service.

after this, you can trying using "curl -k https://domainyoupick/fpm-status?full"
 
Login as the user and check the log of his domains. Look at the biggest one in MB.
Most likely just a heavy bot. Look at the ip adresses and look them up on abuse ip db and block it with csf.
 
@Ohm J I'm going to try that later this evening, would like to have something like that anyway.

@exlhost Ah yes, I didn't think of that, however that's also because mostly I also see these things in the server-status.
 
add something like this
I was trying this evening, but did not work.

Got a "unable to write customisation" with this error:
Code:
AH00526: Syntax error on line 38 of /usr/local/directadmin/data/users/username/httpd.conf:
<LocationMatch not allowed in <Directory> context

I tried this under admin and reseller and the user I want to check, but same error every time. Maybe needs to be under another #custom number?
 
Last edited:
Oke so I have it now like this, everything in #CUSTOM2, is this good?

Code:
<LocationMatch "/fpm-status">
    Order Allow,Deny
    Allow from 127.0.0.1
    Allow from 83.xx.xx.xx
    Allow from 2001:1c05xxx.xxx.xxx::/64
    ProxyPass unix:/usr/local/php81/sockets/someuser.sock|fcgi://localhost/fpm-status
</LocationMatch>
pm.status_path = /fpm-status

I'm getting a 404 error.
 
No, that's for apache customize, php-fpm have separate page. didn't you see any php-fpm relate button in "Custom HTTPD Configurations" ?
 
didn't you see any php-fpm relate button in "Custom HTTPD Configurations" ?
No I didn't at first because I use Enhanced skin. Seen it later on though.

But when I go in Evo skin I see

PHP-FPM config customization for admin php-fpm 8.1​

Then in the tab php-fpm 8.1 |CUSTOM2| in there I put that line:
pm.status_path = /fpm-status
and restarted httpd and php-fpm81 but still a 404.
On that proxypass line I even tried with the server's hostname instead of localhost, but I keep getting the 404.
Here the custom httpd.conf:
afbeelding.png

and the custom php-fpm81.conf:
afbeelding.png


Or can't I create that in admin but do I have to create this in the custom httpd for the user I want to monitor?
 
Since this config put inside some domain virtualhost, so both localhost or serverhostname will not work.

Access with domain "...nl" from your screenshot, it should work fine.
 
Checked the apache log and see this:
[proxy_fcgi:error] [pid 1672582:tid 1673071] [client 2001:1c05:241c:9c00:xxx.xxx.xxx.xxx:58007] AH01071: Got error 'Primary script unknown'

Normal apache log.
[19/Nov/2024:19:41:02 +0100] "GET /fpm-status HTTP/1.1" 404 317
 
He also said got the same errors and did it different, maybe I can try this method of this post.
 
ehhhhh it weird. I usually do this from time to time if I can't identify the problem from the logs.

Or try switch into domain of that's user. but this step isn't needed.


Good luck.
 
Or try switch into domain of that's user. but this step isn't needed.
Seems it's needed. If I use this as admin and then put in someuser.sock I get the file not found.
If I use admin.sock then the page works. However it gives little specific info:
Code:
pool:                 admin
process manager:      ondemand
start time:           19/Nov/2024:19:58:50 +0100
start since:          20
accepted conn:        1
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       0
active processes:     1
total processes:      1
max active processes: 1
max children reached: 0
slow requests:        0
 
all statics format are in the docs.

for me "?full" should be enought when want to find some freeze script.
 
Back
Top