#StackBounty: #apache-2.4 #centos7 #monit Restart apache with monit

Bounty: 50

I’m trying to figure out some issues on my server where my CPU is reaching 100% utilization every other day. This causes all my websites and http services to fail.

How can I configure monit to restart the httpd service when my cpu hits 100% for say 10 cycles?

I’m still new to linux and centos. Learning my way around it and I’ve tried to research this for a while, but I could not find a proper answer to this.

Thanks for looking

Update

Thanks for your response. When the CPUs are running at 100%, I’ve run the top command and I can see that user nobody is consuming all of it on httpd service. I have a few apps that use php scripts, but their error logs all seem fine.

I’m suspecting a particular wordpress theme is causing this error due to a loop while updating the website. This particular website also shows me a loopback test failed error while all other wordpress sites on the same server are running fine.

So, until I can find out the culprit, I simply want to restart the service httpd when CPU utilization reaches say 95% for 10 cycles.

I hope that is enough clarity for someone to kindly give me a solution.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.