CPU Limit

I would say keep away from the following also:

SUSPENSION_DURATION = 300

have it keep checking mysql until the average has dropped to an ok amount (shouldnt take more than a few seconds) and then you simply re-enable the site.... maybe 3 attemps like that an hour then if they exceed the usage amount more than 3 times per hour its set to hold them down for a long duration or something.... not entirely should but leaving the suspend out totally after a certain point seems to remove the idea of the script..... and puttint it as the main feature seems to void it also as Robert stated..

Chris
 
And since you're already getting information out of the status page, would it be possible to get the number of pageviews as well? Because one of my clients accidentily created a loop from one index.php to another and back. The cpu wasn't very high, but since the number kept increasing is surely slowed down apache a lot.

If the number of processes an individual vhost has exceeds let's say 50 or 75 an e-mail would be sent as well. That would require 3 additional fields in the mysql database which would check the number of processes in the same way the cpu gets checked.
 
By "number of processes" which column are you referring to? 'Acc'? Forgive my ignorance :)

Should be able to finish this up tonight by the way.
 
Just the number of processes you see related to a specific vhost. What you do is add up all the loads of the processes, but I'm also interested in the actual number of the processes themselves.

In case of the include loop you'd soon be able to find out that there is an enormous amount of processes going on for a vhost.
 
That's the part that check the database and see if a variable is higher than the threshold level? Because atm I'm still missing the actual purpose part.

And I'm not quite sure on how to run it, if I run it it simple add to the database, but how do I set it to automated runs say every minute?

If this program is finished I think this definately should be part of the chris' new server checklist ;)
 
Right now I'm running it via crontab every 5 minutes:
Code:
*/5 * * * * /usr/local/bin/php /home/........./cpu.monitor.php >/dev/null 2>&1
 
Once its checked over release it in the how-to area and i'll link it up from the checklist :)

Chris
 
Back
Top