difference in idl time
When I run top command on my unix machine (SunOS 5.9 Generic_112233-04 sun4u sparc SUNW,Sun-Fire-880) , it shows the idle time as 1.0% (and keeps changing in the range between 1 and 2%).
But when I run mpstat command the idle time for each processor is shown as 40 plus . Why is there such a huge difference for idle time shown by the top command and the mpstat command and which one should I consider as the more appropriate one ?
Message was edited by:
RameshACSTS
# 2
Hi Darren ,
Here is the output of top command and mpstat command and vmstat command:
load averages: 2.29, 1.70, 1.38 16:36:11
324 processes: 320 sleeping, 2 running, 2 on cpu
CPU states: 27.2% idle, 16.0% user, 7.0% kernel, 49.8% iowait, 0.0% swap
Memory: 8192M real, 4992M free, 3024M swap in use, 8303M swap free
PID USERNAME THR PRI NICE SIZERES STATETIMECPU COMMAND
9114 oracle1 1300K0K cpu/21:53 15.01% oracle
7451 oracle1 362 1296K 1016K run1:29 5.47% gzip
24644 daemon1 6000K0K sleep11:46 4.05% oracle
4364 daemon1 6000K0K sleep2:55 3.47% oracle
7453 oracle1 3720K0K run0:48 3.29% oracle
1806 rkal1 6020K0K sleep7:26 1.87% oracle
28554 oracle1 5900K0K sleep89:15 1.48% oracle
7452 oracle1 4720K0K sleep0:19 1.23% exp
$ mpstat
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 308 11 2415664 598 5448134151 29053879 46
1 305 15 307314669 5568535131 2907396 11 44
2 301 14 2980770 5588435121 2906386 11 45
3 313 16 3408 1177 1026 5248133121 2933426 11 41
$ vmstat
kthrmemorypagedisk faultscpu
r b wswap free re mf pi po fr de sr m0 m1 m2 m5insycs us sy id
1 0 0 8912184 5236176 1119 1223 7817 3 3 0 0 1 1 1 0 2068 11675 2223 39 6 54
Observe that the top command shows idle time as 27.2% where as the mpstat command shows idle time as 40+ for each processor and vmcommand shows id as 54 ( When I ran vmstat , top's idle was 22.5%) .
Thanks,
Ramesh.
Message was edited by:
RameshACSTS
Message was edited by:
RameshACSTS
# 3
Well, the first line of output from vmstat and mpstat will show you the average from the system booted till when you run the command.
To get the current system status you'd have to run
*stat <interval (in seconds)> <count>
for example, to let vmstat poll 10 times with a three second interval:
vmstat 3 10
If you run vmstat like that and ignore the first line of output i'm sure you well get more expected results.
.7/M.