1753317 Members
7162 Online
108792 Solutions
New Discussion юеВ

top vs vmstat

 
Jayraj
Frequent Advisor

top vs vmstat

Hi all,

I find diffrence in the outputs of top and vmstat.

wdroot# vmstat 2 5
procs memory page faults cpu
r b w avm free re at pi po fr de sr in sy cs us sy id
1 1 0 439487 307364 166 37 0 0 0 0 0 2696 18516 1701 100 0 0
1 1 0 439487 307313 30 12 0 0 0 0 0 1196 4043 750 100 0 100
1 1 0 439487 306228 121 22 0 0 0 0 0 1123 10643 587 100 0 100
2 1 0 441189 307313 154 16 0 0 0 0 0 1089 13124 502 100 0 100




top output

Load averages: 0.40, 0.31, 0.30
229 processes: 201 sleeping, 28 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.49 60.0% 0.0% 0.2% 39.8% 0.0% 0.0% 0.0% 0.0%
1 0.34 4.2% 2.2% 0.6% 93.0% 0.0% 0.0% 0.0% 0.0%
2 0.33 32.3% 0.2% 0.2% 67.3% 0.0% 0.0% 0.0% 0.0%
3 0.45 4.8% 1.8% 3.6% 89.8% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.40 25.3% 1.0% 1.0% 72.7% 0.0% 0.0% 0.0% 0.0%


vmstat says cpu idle time is 100% and top says 72, where it is going wrong ?
is it possible to fix anything in vmstat..?
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: top vs vmstat

Shalom,

Neither is wrong.

top is showing you a current picture.

Your vmstat command runs for a short time and take an average.

These are two different utilities for two different jobs, its not an apples to apples comparison.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: top vs vmstat

Hi:

Probably your best tool is 'glance' since it is architected with the HP-UX kernel in mind.

There is a free trial version on the Application DVD/CD if you don't already license it. The version grants a 30-day trial as I recall.

Regards!

...JRF...
Michal Kapalka (mikap)
Honored Contributor

Re: top vs vmstat

hi,

if somebody ask for some tool for system monitoring in case of performance ....,
i always recommend glance or gpm ( gui ).

mikap
Jayraj
Frequent Advisor

Re: top vs vmstat

Hi all,

The intresting thing to note here in the vmstat out put is that..

that the us and id are 100 %..

I think thats where vmstat is going wrong..