View previous topic :: View next topic |
Author |
Message |
TwistedKestrel n00b
Joined: 02 Feb 2003 Posts: 29
|
Posted: Wed Apr 09, 2003 8:06 pm Post subject: 'top' never adds up |
|
|
I wasn't sure where to post this one, so Hardware seems as a good of a place as any ... anyway, whenever I run the top command on my system, the summary of the CPU states at the top of the screen *never* match up with the list of processes ... why? Is there any way to change this, or any better alternatives? |
|
Back to top |
|
|
savage Apprentice
Joined: 01 Jan 2003 Posts: 161
|
Posted: Wed Apr 09, 2003 8:20 pm Post subject: top doesn't add up to 100 percent |
|
|
I suspect the reason that top doesn't add up is simple rounding errors. I recently wrote a load monitor for use in a cluster and I was having the same kind of problems (percentages of use, etc. not adding up) until I increased the number of decimal points a fair amount. It is not a problem with your system / the kernel - just a rounding issue.
i.e. 1.998 gets interpreted as 2.0 |
|
Back to top |
|
|
TwistedKestrel n00b
Joined: 02 Feb 2003 Posts: 29
|
Posted: Wed Apr 09, 2003 9:23 pm Post subject: |
|
|
That's definitely part of it ... but still, when I turn on no-idle, and it only shows one process at 0.9 %, yet the summary says something like 90% user, I think there is more to it than rounding errors. |
|
Back to top |
|
|
AmunRa n00b
Joined: 21 Mar 2003 Posts: 3
|
Posted: Thu Apr 10, 2003 1:56 am Post subject: |
|
|
the numbers don't 'add up' for a number of reasons. Firstly the actual act of monitoring the processes takes up some CPU - a good example of the scientific principle that observing something changes it In addition, top only checks every x seconds, otherwise it would take up a large chunk of the processor. Therefore in actual fact for a few milli/microseconds top is probably taking up most of your CPU time, and so the resulting numbers won't add up. You'll notice this if you manually refresh top (by pressing space) quite quickly - your usage will shoot up. Top is notoriously system intensive, due to it's continual nature - leaving it running on a busy system is not a good idea The occasional 'ps -efa' or 'w' is much more system friendly...
Secondly, as previously mentioned, there are rounding errors introduced.
Regards
Dave |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Thu Apr 10, 2003 2:06 am Post subject: |
|
|
That still doesn't explain a 89% discrepancy... it shouldn't be off more than a couple percent really.
Something weird is probably happening in the kernel or something... I don't know. |
|
Back to top |
|
|
Cyclone n00b
Joined: 27 Jan 2003 Posts: 23
|
Posted: Thu Apr 10, 2003 1:22 pm Post subject: |
|
|
Are you running ACPI in your kernel? I know from personal experience that at least in patches as recent as 12/12/2002 that ACPI makes my system load skyrocket. _________________ Cyclone
Successfully running Gentoo 1.4 on a Toshiba 2415-s205 from stage1 |
|
Back to top |
|
|
|