1

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?

4 Answers 4

5

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.

1
  • 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, 2011 at 18:50
2

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

0

Try using cacti:

http://www.cacti.net/index.php

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .