Understanding "top" command

Hi all,
I need a clarification about the top command in HP-UX.

If I run:

top -s300

I see the screen refresh every 5 minutes.
From the "man top" I understand that the values displayed every 5 minutes are instantaneous, not average on the previous 5 minutes.
Is this interpretation correct?

In case I want average values "glance" is the correct tool?
Or maybe SAR is better?

Thank you very much!
Evan

All of the performance statistics programs take statistics at a user-defined interval. If not, they would bombard the kernel with requests and make the computer slow.

Programs top and glance are designed for short-term monitoring of a server.
Programs vmstat iostat , and sar are suitable for long-term monoring as well as snapshots. Of these sar (see man sadc ) is most suited for gathering historical statistics.

Might help if you mentioned what statistics you are looking at and why!

To answer your question, none of them are a continuous rolling average. Some of the figures in glance and top are cumulative since the monitoring began but details of individual processes come from the kernel's records since the process started (which could be months or years ago, depending on how often you boot your servers).

Dear methyl,
thank you very much for your reply.

I would like to monitor the cpu consumption of all the processes that are listed in "top" (or at least all the processes that are over a certain threshold) with 5 minutes average.

Now we use "gasgauge" but I think that it's a former Lucent closed source app, can't find any reference around the web.

But the infos you gave me are enought because my boss won't allow me to install any software (such as sar) on the server :slight_smile:

I'll read more on vmstat and iostat.

Thanks again,
Evan

And sar, iostat and vmstat won't monitor individial processes.

You will need to use ps if you want to identify high cpu load from individual processs in an automated script or glance or top for a rolling snapshot.

HP and others will sell you monitoring packages. If you have HP Openview you can write your own alerts or adapt those supplied.

Be very careful how you interpret figures in the context of what is "normal". It is a common mistake to say interpret 100% cpu use by a single process (on a 32-processor computer) as being a problem. I find that process duration (against "normal") and cpu usage by time are more useful metrics.

1 Like