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
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.
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
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