Monitor Apache system load
Q My customers have been reporting my website being down, usually around peak times. Could you suggest a simple way to monitor my system load?
A An Apache slowdown is almost always due to memory. If you're not looking for something like Cacti (http://cacti.net), which uses RRDtool to record almost anything imaginable on a server, the simplest way I can think of is to have a shell scriptlet that just runs an infinite loop while capturing the output from a couple of utilities. You could use sar to monitor CPU usage, free for memory usage and vmstat. Use this last tool with a delay of three to five seconds to capture a couple of successive snapshots of your system state - this is just to make sure that the information you're getting from the redirected outputs are not spikes. Use your judgement as to how frequent the dumps are made unless you're prepared to code a monster application to sift through all the information.
Follow us on Identi.ca or Twitter