Sometimes, My apache/Passenger Rails server just spikes to 100% CPU usage and stops working. I need a way to monitor what process spikes it to 100% usage ?. What tools can i use to monitor such things

Thanks

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

I like Nagios(http://www.nagios.org/) and Zabbix(http://www.zabbix.com/). Monit(http://mmonit.com/) can repair system.

If you need graphics use Zabbix, if you need manage and repair use Monit, other use Nagios. If you do not need web managemnt and status, use nagios-plugins check_cpu and your favorite programming language.

link|improve this answer
feedback

If you want to monitor the server processes to see the problem ones, just setup a script to take a snapshot when CPU usage or load average gets too high and put it in a cron

#/bin/bash
if [[ `cut -d. -f1 /proc/loadavg` -gt 4 ]]; then
    top -n 1  | head -n20 >> /tmp/process-check.log
fi

If you need to see inside of Apache, enabled server-status and do run curl to pull in a snapshot of the server-status if load or CPU usage gets too high.

More on mod_status at http://httpd.apache.org/docs/2.0/mod/mod_status.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.