Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
'top' never adds up
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
TwistedKestrel
n00b
n00b


Joined: 02 Feb 2003
Posts: 29

PostPosted: Wed Apr 09, 2003 8:06 pm    Post subject: 'top' never adds up Reply with quote

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
View user's profile Send private message
savage
Apprentice
Apprentice


Joined: 01 Jan 2003
Posts: 161

PostPosted: Wed Apr 09, 2003 8:20 pm    Post subject: top doesn't add up to 100 percent Reply with quote

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
View user's profile Send private message
TwistedKestrel
n00b
n00b


Joined: 02 Feb 2003
Posts: 29

PostPosted: Wed Apr 09, 2003 9:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
AmunRa
n00b
n00b


Joined: 21 Mar 2003
Posts: 3

PostPosted: Thu Apr 10, 2003 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Thu Apr 10, 2003 2:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Cyclone
n00b
n00b


Joined: 27 Jan 2003
Posts: 23

PostPosted: Thu Apr 10, 2003 1:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum