I have recently encountered an issue with php-fpm processes usage (As in the amount of active processes) peaking to the maximum available processes and by that stopping execution of other scripts until the problematic processes finish.
In a bit more detail, my current php-fpm settings are:
pm = static
pm.max_children = 100
I am watching the php-fpm's status page, which most of the time shows:
total processes: 100
idle processes: 95-99
active processes: 1-5
which is normal. However, ever few minutes the active processes count jumps to 100 for a few seconds, and then goes back to normal of 1-5. in that time all other scripts running on the server are simply stuck for that period of time. (From the browser you simply see the page waiting).
Now, i have checked to see if its in specific traffic spikes, but its not. it can also occur with the lowest traffic count of the day.
I believe that a certain script, maybe even only in specific situations, is causing php to simply use all available processes for some reason.
This issue started once we moved to PHP 5.4.X from 5.2.X
We currently have around 60 websites, so its kinda hard going through each website's pages and checking it.
There is nothing in the nginx logs (Nothing critical anyway, there are a few Notices and such).
What i'm trying to do, is somehow trace/profile/monitor which php-fpm script is using the processes so i will know where to start looking for the problem.
Is this possible? Maybe a different approach?
Update
Here is a graph of the PHP-FPM process count in 1 hour, in 1 min intervals:
I have marked in red the jumps that i'm talking about. The memory usage at the time of the spike stays the same