LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Why %CPU total not equal to cpu(s) usage? (https://www.linuxquestions.org/questions/linux-server-73/why-cpu-total-not-equal-to-cpu-s-usage-687631/)

pii.ajah 12-02-2008 12:18 AM

Why %CPU total not equal to cpu(s) usage?
 
Hi All...

I'm a newbie in linux world.
I have tried to google for top command, but til now I cannot find any information why %CPU(in detail) total is not equal to cpu(s) usage(in summary part) (or is %CPU and cpu(s) usage are different function?)
Can someone tell me why are these values is different?

my machine is single core.
customize linux with kernel 2.4.32

thanks.

zeno0771 12-02-2008 01:24 AM

If I understand you right, it can be explained by a couple of things:

1. Total CPU usage is a combination of user load, system load, and nice load. A number of things are going on in the background that will take up CPU cycles. CPU % is, generally speaking, how much of the CPU is being utilized at any given time; therefore these numbers may not be equal at a specific point in time, nor will they always add up to an even 100%.

2. There may also be a slight difference or delay in reporting times for various parameters depending on motherboard and/or CPU sensors; you have to remember that modern CPUs complete more than a billion clock cycles per second. A program capable of measuring CPU usage at that high a resolution would likely consume a large amount of CPU cycles itself just to operate, thereby skewing the results further.

I tend to pay fairly close attention to CPU performance myself as I've overclocked my Quad. I use GKrellm to monitor the core % usage and temperatures, and I have GKrellm set to do 10 updates per second, which I feel is a fair balance between accuracy and usage. This is adjustable, but as I've said previously, the higher the resolution (i.e. number of updates per second) the more CPU GKrellm itself will use.

Hope that helps.

pii.ajah 12-02-2008 08:30 PM

Hi zeno

Thanks a lot, now I understand. :)


All times are GMT -5. The time now is 10:11 AM.