-1

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

Rishav
  • 220
  • 2
  • 10

2 Answers2

3

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.

Oscar Foley
  • 332
  • 4
  • 18
bindbn
  • 5,211
  • 2
  • 26
  • 24
2

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

Jim
  • 398
  • 2
  • 9