Tuesday, February 07, 2006

Load - in Linux / Unix

Yesterday I was working on one server. Server was very very slow, and when I looked at Top command I got load average of 0.0, 0.15, 0.27 which was not what I expected. Generally load average should be higher than this. But curiously I looked at man page of Top. But somehow "man page of top" did not give me proper answer to this Load Average number. Surprizingly uptime and w commands also give you same kind of output. So what are these load average numbers? And how kernel or any command computes these number?

I started searching about it and finally came across this article

Which clearly says something like this :

Those three little numbers tucked away innocently in certain UNIX commands are not so trivial after all. The first point is that load in this context refers to run-queue length (i.e., the sum of the number of processes waiting in the run-queue plus the number currently executing). Therefore, the number is absolute (not relative) and thus it can be unbounded; unlike utilization (AKA ``load'' in queueing theory parlence). Moreover, they have to be calculated in the kernel and therefore they must be calculated efficiently. Hence, the use of fixed-point arithmetic and that gives rise to those very strange looking constants in the kernel code.

No comments: