4

I know that load average is 0-1(or 0-1024) per cpu. E.g a busy quad-core can have a load average of 4.0 or higher. (e.g if there are many tasks). I understand it can be huge like 100+ etc.

I also understand it's not cpu utilization (i.e it can go beyond 100%), but it does reflect what the cpu is capable of.

But why is it not automatically divided by the number of CPU's in the system?

This is more of a historical question. Why is:

(load)

and not :

(load) / (# of cores)

with all cpu's taken into account? Why is it per-cpu? Having it per-cpu means I first have to find out how many cpu's the system have, then divide that number to get a meaningful number. This is cumbersome when managing many different systems.

This is for Linux.

7
  • 3
    No, it's the average number of processes in the run queue, that is either currently running, or wanting to run. That's independant from the number of processors. That number can reach thousands on a one single-core processor system. Jun 23, 2015 at 14:59
  • Well, that doesn't answer the question really. It can be 4000 on a quad core, but why isn't it 1000 so that it is divided among the cpu's? Jun 23, 2015 at 15:28
  • 3
    It's the average load of the system, not the average load of its CPUs. Jun 23, 2015 at 15:33
  • But wouldn't the average be different depending on the performance of the CPU? e.g a quick cup can handle more jobs than slow cpu, thus it's load average would be lower. So in some ways it is a load on the cpu. Jun 24, 2015 at 13:51
  • 1
    A load of 4 means the system is on average doing 4 things at once. A system with a 4GHz CPU or a 4-core CPU will do those 4 things 4 times as quickly as one with a 1GHz CPU or 1-core CPU but that's besides the point. Yes a load per CPU could be useful as another metric because the 4GHz vs 1GHz case is different from the 4-core vs 1-core as with a per-CPU load <1, the CPU is under used so you can give your system more to do (or it's no use adding more CPUs), but that's another metric and one that can easily be derived from the system load. (also, the load also counts uninterruptable sleep ps). Jun 24, 2015 at 13:59

2 Answers 2

3

The load average does not just cover processes using CPU time or waiting for it. It also covers those processes in uninterruptable sleep (which usually means waiting for disk I/O).

Dividing by the number of CPUs would lead to some bizarre (and often useless) numbers. If you have a system with 4 cores and 7 processes waiting for a single disk, the load average according to your definition would converge towards 1.75. But that number means nothing. Dividing by number of cores when measuring an I/O bound workload would give a meaningless result.

It would certainly be possible to compute an average number of processes waiting for CPU and an average number of processes in uninterruptable sleep. The sum of those two numbers would be the traditional load average. The average number of processes waiting for CPU divided by number of CPUs could also be a meaningful number in some contexts.

The average number of processes in noninterruptable sleep divided by number of disks however would not be meaningful. After all being in noninterruptable sleep doesn't signify which disk it is waiting for, and it is also not clear if number of disks should count virtual devices as well.

1

You didn't say but I'm assuming this is for Linux. Even though you are looking for the historical reason for it being per CPU, your question indicates that you are still thinking of the load average in terms of CPU utilization instead of the kernel job queue that it really is. You can still see CPU utilization in programs like top if you want to see a % usage per CPU.

If you have 4 CPU cores then that means that the kernel can queue up 4 tasks at once for 4 CPUs. Thus you end up with a load of 4 + some baggage. If the kernel queues up more tasks behind those that are running, then the number goes up higher than 4. Its not a 0 to 100% scale at all and the number goes as high as it needs to based on the workload. I once saw the load go up to over 15,000 because of a backlog of IO jobs on a failing network filesystem. The number actually will reset after it hits 1024.

1
  • I tagged it as linux, but edited the question to better reflect things. I understand that it goes beyond '1'. E.g it can be 15,000 on a quad core. But why doesn't it show 3750 on a quad-core (15k/4) ? Jun 24, 2015 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .