0

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.

Captain Obvlious
  • 19,754
  • 5
  • 44
  • 74
EmptySD
  • 131
  • 1
  • 7

1 Answers1

0

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.

Raul Andres
  • 3,766
  • 15
  • 24
  • Any suggestion for monitoring program? – EmptySD Jan 10 '14 at 13:52
  • [http://mmonit.com/monit/] is simple and easy to use. For a large environment i would use Nagios. I don't know how nagios perform in a single server – Raul Andres Jan 10 '14 at 13:54
  • Thank you Raul for your answer, i will definitely try some of them, if that is only possible way. I am manually monitoring server all the time because of that. Sometimes problem is not happen in 3 days and sometimes it happen 3 of them due the night. I hope its possible to run something as cron job and do termination of it. – EmptySD Jan 10 '14 at 14:05