guy keren wrote:

On Mon, 28 Mar 2005, Oron Peled wrote:



The load average is not in percentage. The load average numbers are the
average number of processes waiting/using for CPU in the last 1, 5
and 15 minutes [remark: on Linux processes in the 'D' (uninterruptible
sleep) are weirdly in this count also].



i'm not sure it's 'wierd' - it's probably a matter of philosophy (a
process is supposed to be in D state only if it is in the middle of
changing data structures and they are in an inconsistent state, so it must
be able to get a hold of a lock or something. you could think about it as
something similar, in perception, to a spinlock).


Pressing a key on the shell puts it into the "Ready" queue. The idea is that the load average will give you a realistic number saying "how responsive is my system". A load average of 1 means that my shell has now, on average, 1 process ahead of it before it gets the CPU. In a way, the load average tells you more about the system's load then the CPU stats do.

Processes should never spend too much time in the "D" state. The very fact that certain activities mean you are almost guaranteed to see processes in the "D" state means there are bugs in the kernel. However, these are unrelated to system load. A process in the "D" state is not consuming CPU, and will not prevent my shell from getting to the top of the "ready" queue and getting the CPU. "D" state processes distort the load average number.

2. this is more important: what's the relation between load average and
  CPU idle time. according to the above stats, the CPU is 60% idle. is it
  because:

a. it keeps waiting for the memory or cache to respond?
b. something else?


Maybe the load pattern is that he has lots and lots of very small processes, all waiting on the same resource to become available. If we had 6 processes all waiting on a single resource, which becomes available once a second, then they would all enter the "Ready" queue at once. If it takes 40% of the CPU's power to handle these processes, then the CPU will be 60% idle, but the average load would be "1". If instead of 6 processes we would have 11, then the average load would be 2, but the CPU would still be 60% idle.

You may have to tweak the numbers a bit, but it seems about right. A different question is whether, under this scenario, the load average is still the right metric to look at? I think it is. If the load average is 2, my shell still have quite a queue to wait for being actively processed, and the responsiveness will depend on the time slices alloted to each process.

            Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html


================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to