Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 3 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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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