Portal Home > Knowledgebase > Articles Database > Script for email alerts if PHP-FPM exeeds x # of processes


Script for email alerts if PHP-FPM exeeds x # of processes




Posted by hydn, 02-20-2015, 03:48 PM
We can set pm.max_children to restrict the # of processes. But I'd like to login and view the server whenever PHP-fpm processes increase past x of processes. So if pm.max_children is set to say 100, I would like an email alert when it exceeds 50 so I can login look around. Is there a script/method for this to send an email when # of PHP-FPMs have surpassed a particular #? Thanks.

Posted by Swiftnode, 02-20-2015, 07:39 PM
Hayden, Here's a bash script you can run minutely via cron. Probably not the cleanest way to do it though.

Posted by hydn, 02-20-2015, 08:04 PM
Thanks for this. I will give it a try and confirm in case anyone else lands here via google.

Posted by hydn, 02-20-2015, 08:22 PM
Cannot edit my post above. Just confirming this works.

Posted by LittleApps-Nick, 02-21-2015, 01:05 AM
What's the point of fixing the problem as it happens, when you can stop it from happening in the first place? There's plenty of good guides (like this one) which has some tips on how to optimize PHP-FPM.

Posted by hydn, 02-21-2015, 01:24 AM
There's no "problem" traffic is just very random, will login when its in beast mode. It all graphed and everything but its nice to be on in real time. Thanks though. Last edited by hydn; 02-21-2015 at 01:39 AM.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
squirrelmail (Views: 580)