How is CPU usage calculated?

Коньков Евгений kes-kes at yandex.ru
Mon Oct 18 20:46:28 UTC 2010


Здравствуйте, Adam.

Вы писали 18 октября 2010 г., 23:35:55:

AVM> On Mon, Oct 18, 2010 at 3:06 PM, Martin Turgeon
AVM> <freebsd at optiksecurite.com>wrote:

>> I just reread it and it isn't clearer what is using the CPU so much. Can
>> you please give me a little more explanation?
>>

AVM> A line in top(1) like:

AVM> CPU:  0.0% user,  0.0% nice,  0.4% system,  0.4% interrupt, 99.3% idle

AVM> does not describe how much CPU is being used, but rather a "percentage of
AVM> time spent in each of the processor states".  It's saying of the CPU cycles
AVM> that are being used, this is what it breaks down as.  Since MySQL is a
AVM> userland application, you'd expect the value of user to be quite high if
AVM> that was only thing running on your system and it was under high load.

AVM> You can infer how much CPU is being used from the line, but there are better
AVM> and more accurate methods generally of getting that information especially
AVM> with SMP systems.


some times ago I was interested in this question also.
From this explanations I undestand nothing.
>>you'd expect the value of user to be quite high if that was only thing running on your system and it was under high load.
1. 'values of user' which value??? or value of what???
2. 'quite high' how much it is?
3. 'high load' how I can detect that high load???

in man pages no usefull info except description of options.
there are no examples how %idle system etc are calculated
what is WCPU and CPU and how they are calculated NO EXAMPLES
no example how find processes which take hole CPU time\

top is powerfull tool, but whiout docs it seems useless. that is sad


-- 
С уважением,
 Коньков                          mailto:kes-kes at yandex.ru



More information about the freebsd-questions mailing list