Understanding "top" command


 
Thread Tools Search this Thread
Operating Systems HP-UX Understanding "top" command
# 1  
Old 07-25-2012
Understanding "top" command

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

If I run:
Code:
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
# 2  
Old 07-25-2012
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).

Last edited by methyl; 07-25-2012 at 10:52 AM..
# 3  
Old 07-25-2012
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 Smilie

I'll read more on vmstat and iostat.

Thanks again,
Evan
# 4  
Old 07-25-2012
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.
This User Gave Thanks to methyl For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Understanding output of "last" command

Hello, Been looking through Google, and I don't see a direct answer to this: # last ... abcd pts/1 srever02 Mon Feb 23 07:56 - 07:56 (00:00) abcd sshd server02 Mon Feb 23 07:56 - 07:56 (00:00) klmn sshd ... (2 Replies)
Discussion started by: kitykitykity
2 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. UNIX for Dummies Questions & Answers

How to put "top" command in crontob?

Hi, how to put "top" command in crontab through script in suse linux. Below script is working fine, but it is not working when sheduled in crontab script scheduled in cron: health.sh --------- #! /bin/ksh top |head -5 >output.txt Thanks Suresh (3 Replies)
Discussion started by: suresh3566
3 Replies

4. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

5. Shell Programming and Scripting

Retrieve RAM memory size from "top" command output

Hi, I am trying to get the system RAM size from "top" command's output by the following but it is not working. top | sed "s/^Mem.**\(*\), *//" (10 Replies)
Discussion started by: royalibrahim
10 Replies

6. AIX

AIX 5.3 - Discrepancies between "top" and "vmstat"

Can someone explain the differences I'm seeing below in TOP and VMSTAT commands on my AIX 5.3 server? Thanks! CPUs: 4; load averages: 0.86, 0.97, 0.97 18:09:26 926 processes: 4 stopped, 922 running CPU states: 78.4% idle, 8.5% user, 12.6% kernel, 0.3% wait Memory: 23680M Total.... (1 Reply)
Discussion started by: troym72
1 Replies

7. UNIX for Dummies Questions & Answers

start top command in "solaris mode"

Ever noticed that using the top command on a multiple cpu box can often give totally misleading answers, like 230%, when you think that 100% should be the max? Well, that's because top has a bizarre mode called "Irix mode" wherein if you have 4 cpus, the %CPU column of top can go up to 400%. I... (1 Reply)
Discussion started by: fabulous2
1 Replies

8. UNIX for Dummies Questions & Answers

running command "top" in cron

hi all, i would like to collect stat. about the cpu usage every 30 mins so, I set up the cron job sth like 0,30 * * * * * /usr/bin/top -d 1 >> $STAT i know cron doesn't have a TERM output, so error occurs. any ideas or work around for this?? many thanks (3 Replies)
Discussion started by: freddy1228
3 Replies

9. Debian

Debian: doubt in "top" %CPU and "sar" output

Hi All, I am running my application on a dual cpu debian linux 3.0 (2.4.19 kernel). For my application: <sar -U ALL> CPU %user %nice %system %idle ... 10:58:04 0 153.10 0.00 38.76 0.00 10:58:04 1 3.88 0.00 4.26 ... (0 Replies)
Discussion started by: jaduks
0 Replies

10. UNIX for Dummies Questions & Answers

Any limitations to the "top" command?

Anyone know of any limitations? Also, does anyone know a great way to determine which processes are hogging CPU? TIA (6 Replies)
Discussion started by: lawadm1
6 Replies
Login or Register to Ask a Question