Automatically Kill Apache Process if it Use 100%

1k Views Asked by At

I am using CentOS 5 + Webmin and Apache server. Sometimes it happen that some Apache process leave open connection and it use 100%. That can increase load average for +1. If sometimes happen more then one, there is a problem with load average, it's increased for 1-2-3. Is it possible to add automatically kill Apache PID if it use 100% ? Or if is live longer then some time?

After manually terminate that PID, everything is back to normal, I would just like to find automatically way to terminate it in case it happen.

1

There are 1 best solutions below

3
On

You should use monit or some similar solution, that allows you to monitor a process and take an action when CPU or memory usage is above any threshold.