Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I will be running a custom daemon that could potentially spike the server's cpu? Is there a way to log those spikes with their start and running time?

share|improve this question
up vote 5 down vote accepted

If youre running linux or other unix variant, there is sar which is installed by default in many distributions. Many times it runs from cron on a defined interval, however you can also run it manually with a specified polling interval

For example:

sar -u 1 0

This will run sar once a second forever. The -u tells it to output the CPU usage info, the 1 is how many seconds between polls, and the 0 is how many times to poll (0 for forever).

It can also watch a specific process with the -x parameter. It can also log its data to a file for later viewing. Sar can do a lot, so consult the man page if you want to do more.

share|improve this answer
This is typically what we do too, because it is really quite easy to get it running. The one point is that it takes a snapshot of that point in time. So as long as you are doing them pretty frequently, it isn't a problem. If you bump the interval up to 5 or 10 minutes, you may miss the time when the app is actually spiking. – Alex Jan 31 '11 at 18:50

Use any monitoring system(Cacti,Zabbix,Munin,...) for monitoring daemon memory usage.

share|improve this answer

Try using cacti:

share|improve this answer

I would say if you have a bunch of servers to monitor, get a "utility server" and take the time and setup munin (what I use), or cacti or zenoss or ganglia or whatever you like.

But if it's a one-off server, go with sar, which is part of the sysstat suite. Usually it's run from cron. In Debian systems, you'll have to enable it in /etc/defaults/sysstat. You can graph the results with ksar.

share|improve this answer

Your Answer


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.