Help - Search - Members - Calendar
Full Version: Odd Cpu Usage Data
Linuxhelp > Support > Technical Support
WereTiger
I have two poweredge 750s, both running Slackware 10 and the applications and tools installed should be virtually identical.

One has 1000+ processes, which is fairly normal for it (they're all 0% usage instances of Java applets), the other has 150 processes, which is normal for it (again, 0% Java applets, just fewer of them)

whenever I run 'top' on the system with 150 processes it shows ~88% CPU usage (user) for the first refresh, then 1-2% CPU usage from then on (for that execution of top).

the other system runs top and returns 'normal' CPU usage for user, but a lower usage of 'system' for the first set of data, followed by higher system (25% or so).

I don't get it, why is top being such a spaz??

FreeBSD's version of top doesn't show the CPU usage data for the first screen refresh at all.

CODE
zimdev@mc2:~$ top b n 5 | grep 'Cpu'                                          
Cpu(s):  88.6% user,   0.4% system,   0.0% nice,  10.9% idle
Cpu(s):   1.0% user,   3.3% system,   0.0% nice,  95.8% idle
Cpu(s):   2.6% user,   2.9% system,   0.0% nice,  94.4% idle
Cpu(s):   1.3% user,   1.3% system,   0.0% nice,  97.4% idle
Cpu(s):   2.0% user,   1.6% system,   0.0% nice,  96.4% idle
zimdev@mc2:~$ top b n 5 | grep 'Cpu'
Cpu(s):  88.6% user,   0.4% system,   0.0% nice,  10.9% idle
Cpu(s):   2.6% user,   2.3% system,   0.0% nice,  95.1% idle
Cpu(s):   3.3% user,   6.2% system,   0.0% nice,  90.5% idle
Cpu(s):   2.0% user,   4.6% system,   0.0% nice,  93.5% idle
Cpu(s):   1.6% user,   3.3% system,   0.0% nice,  95.1% idle

zimdev@mc2:~$ top b n 1
top - 13:31:31 up 17 days, 15:53,  4 users,  load average: 0.15, 0.05, 0.01
Tasks: 150 total,   1 running, 149 sleeping,   0 stopped,   0 zombie
Cpu(s):  88.6% user,   0.4% system,   0.0% nice,  11.0% idle
Mem:   2069116k total,  1431972k used,   637144k free,   165240k buffers
Swap:  1951888k total,        0k used,  1951888k free,  1052928k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
7989 zimdev    15   0  1008 1008  744 R 10.7  0.0   0:00.13 top                
<!-- snip, nothing interesting in here but a lot of 0% usage procs -->

==============

And now, on a similar system:

zimdev@mc1:~$ top b n 5 | grep Cpu
Cpu(s):   1.8% user,   0.5% system,   0.0% nice,  97.7% idle
Cpu(s):   1.2% user,  25.8% system,   0.0% nice,  73.0% idle
Cpu(s):   1.0% user,  26.3% system,   0.0% nice,  72.7% idle
Cpu(s):   1.0% user,  25.5% system,   0.0% nice,  73.5% idle
Cpu(s):   2.2% user,  24.5% system,   0.0% nice,  73.3% idle
zimdev@mc1:~$ top b n 5 | grep Cpu
Cpu(s):   1.8% user,   0.5% system,   0.0% nice,  97.7% idle
Cpu(s):   2.4% user,  26.0% system,   0.0% nice,  71.6% idle
Cpu(s):   0.7% user,  26.0% system,   0.0% nice,  73.3% idle
Cpu(s):   2.9% user,  25.5% system,   0.0% nice,  71.5% idle
Cpu(s):   2.5% user,  25.8% system,   0.0% nice,  71.7% idle

zimdev@mc1:~$ top b n 1 | less
top - 09:47:28 up 17 days, 16:08,  7 users,  load average: 0.16, 0.11, 0.05
Tasks: 1058 total,   1 running, 1057 sleeping,   0 stopped,   0 zombie
Cpu(s):   1.8% user,   0.5% system,   0.0% nice,  97.7% idle
Mem:   2069116k total,  2014948k used,    54168k free,    70720k buffers
Swap:        0k total,        0k used,        0k free,  1255596k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
7503 zimdev    14   0  1552 1552  744 R 67.3  0.1   0:02.11 top                
15138 zimdev     9   0 34140  33m   9m S  0.6  1.6   1:45.48 java              
30317 zimdev     9   0 29072  28m  10m S  0.6  1.4   0:06.18 java              
<!-- snip : more useless stuff -->
WereTiger
I just noticed this in iostat's FAQ (which is a comperable tool I've just downloaded to troubleshoot with);

CODE
3.5. Why values displayed by iostat are so different in the first report
    from those displayed in subsequent ones?

Probably because, as written in the manual page, the first report generated
by iostat concerns the time since system startup, whereas subsequent ones
cover only the time since the previous report (that is to say, the interval
of time entered on the command line).


does 'top' do the same?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.