PHP-FPM Master ramping CPU usage, weird processes

21 views
Skip to first unread message

Lukas Reeves

unread,
Apr 11, 2025, 6:31:47 PMApr 11
to highload-php-en
Hey there!

Our php-fpm has been acting very strangely, which requires monitoring and fairly often restarts. It can run fine for a few days, or start to go crazy just an hour after we restart it.
 
[www]

pm = dynamic
pm.max_children = 256
pm.start_servers = 32
pm.min_spare_servers = 16
pm.max_spare_servers = 32
pm.process_idle_timeout = 10s;
pm.max_requests = 500

We also have our max time for php scripts to run set to 20 minutes.

This is a VM with 4 cores and 30GB of RAM allocated. RAM has so far never been an issue.

We aren't sure what sets it off. All of our large automated scripts run through the terminal, so outside of FPM. We run Apache for everything else, which points to back-ends.

An interesting thing is that when it starts to go haywire, more and more of these show up in FPMs status page:

3475314
(null)
11/Apr/2025:16:31:49 -0400
0
0
352324290549
-
-
0
-
-
0.00
0

The status page will also display varying numbers of process, from 32 to 68 to 120 to 40 to 150, etc. The weird thing about this is that we have monit running. Both monit and our process list in the terminal only resolve to 32 child processes. 

One last thing to note is that when left too long, we can see that the master process lags behind in reading zombie processes to fully close them.

FPM is majorly bugging out and I was hoping someone could shed some light on things.
Reply all
Reply to author
Forward
0 new messages