November 26, 2026

Linux Load Average Explained: What the Three Numbers Count

Boiler pressure gauge reading high while the burner below it is dark and cold

loadavg=3.46 2.49 1.42, with the CPUs 98% idle. That line came from a two-vCPU test container about a minute and a half after four processes got stuck writing to a frozen filesystem. None of the four used any CPU. Each one sat in the kernel waiting for a lock that wasn’t coming, and the load average climbed steadily the whole time anyway. On most Unix systems that number would mean the CPUs were oversubscribed. On Linux it means something broader, and the difference traces back to a single patch from 1993.

Video: Learn Linux TV on YouTube

What the three numbers count

Runnable tasks plus tasks the kernel won’t interrupt

uptime, top and w all print the same three figures from /proc/loadavg. The proc_loadavg man page describes them as “the number of jobs in the run queue” … “or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.” The file carries two more fields: a pair like 1/225, where the first number is “currently runnable kernel scheduling entities” and the second is how many exist, and the PID of the most recently created process.

The kernel source is more exact than the man page. The header comment in kernel/sched/loadavg.c says the global load average “is an exponentially decaying average of nr_running + nr_uninterruptible.” Running means on a CPU or waiting for one. Uninterruptible means state D, sleeping in the kernel in a way signals can’t break, which is usually disk I/O but can be a lock, a frozen filesystem or an NFS server that stopped answering. The man page’s phrase “waiting for disk I/O” describes the common case and leaves the rest out.

That second term is the Linux peculiarity. Brendan Gregg, who investigated the history in a 2017 post, found that “The original load averages show only CPU demand,” and that Linux changed when Matthias Urlichs sent a patch in an email dated October 29, 1993, subject line “Load average broken ?”. Urlichs argued that “processes which are swapping or waiting on “fast”, i.e. noninterruptible, I/O, also consume resources.” Gregg reports the change first appeared in Linux 0.99 patchlevel 14 in November 1993. His summary of the effect is that Linux moved from CPU load averages to what he calls “system load averages.”

Four trucks waiting in line at a closed loading dock door while other bays sit empty

The math behind 1, 5 and 15

A leaky bucket sampled every five seconds

The three numbers aren’t averages over fixed windows. Gregg calls them “exponentially-damped moving sums of a five second average,” and the kernel’s own comment gives the update rule, avenrun[n] = avenrun[0] * exp_n + nr_active * (1 - exp_n). Every five seconds the kernel takes the old value, keeps a fixed fraction of it, and blends in the current count.

The fractions live in include/linux/sched/loadavg.h as fixed-point integers: FIXED_1 is 2048 (1.0), LOAD_FREQ is commented “5 sec intervals,” and the three constants are EXP_1 1884, EXP_5 2014 and EXP_15 2037, each commented as 1/exp(5sec/1min) and so on. A short Python script turned those into decimals and ran the update rule:

1 min: exp const 0.919921875   ideal 0.9200444146293233
5 min: exp const 0.9833984375  ideal 0.9834714538216175
15 min: exp const 0.99462890625 ideal 0.9944598480048967
1-min after 60s of 1 task: 0.633
5-min after 60s: 0.182   15-min: 0.063
seconds for 1-min to fall from 4.0 below 0.5: 125
seconds for 15-min to fall from 4.0 below 0.5: 1935 = 32.25 min

One busy task for one full minute pushes the “1-minute” average to 0.63, not 1.0. Gregg measured the same thing experimentally and found it “only reaches about 0.62 by the one minute mark.” The 15-minute figure is a long memory: a spike to 4 takes more than half an hour to drain below 0.5. A box that had a bad quarter hour still looks loaded in uptime long after the problem cleared, like a boiler gauge that keeps reading hot after the burner shuts off.

Two tests on a two-core box

One load from CPU hogs, one from tasks doing nothing at all

Both tests ran on an Ubuntu 24.04 test container with 2 vCPUs (kernel 6.18). The container shares its VM with other background work, so the baseline was never zero; the starting values are shown and the model includes them.

The first test used stress-ng --cpu 4 --timeout 90s, four workers spinning on two cores. Sampled roughly every twenty seconds:

t=  0s  loadavg=0.58 0.80 0.38
t= 21s  loadavg=1.55 1.01 0.46
t= 42s  loadavg=2.68 1.31 0.58
t= 62s  loadavg=3.12 1.50 0.66
t= 83s  loadavg=3.44 1.68 0.74

CPU idle was 0.0% for the whole run. Running the kernel’s update rule from that starting point with four active tasks predicts 3.17, 1.59 and 0.70 after 85 seconds. The measured numbers ran slightly higher, which fits the other work on the VM adding a little of its own.

The second test froze the ext4 test filesystem with fsfreeze -f. The fsfreeze man page says “Any process attempting to write to the frozen filesystem will block waiting for the filesystem to be unfrozen.” Four small dd writes went in and stopped:

  PID STAT WCHAN                COMMAND
19880 D    percpu_rwsem_wait    dd
19881 D    percpu_rwsem_wait    dd
19882 D    percpu_rwsem_wait    dd
19883 D    percpu_rwsem_wait    dd

Then the sampler, which reads CPU idle from /proc/stat over each ten-second interval:

t= 10s loadavg=1.67 2.00 1.18 1/225 D=4 cpu-idle(last 10s)=99%
t= 30s loadavg=2.33 2.13 1.24 1/232 D=4 cpu-idle(last 10s)=99%
t= 50s loadavg=2.80 2.25 1.30 2/228 D=4 cpu-idle(last 10s)=98%
t= 70s loadavg=3.14 2.37 1.36 1/230 D=4 cpu-idle(last 10s)=98%
t= 90s loadavg=3.46 2.49 1.42 1/233 D=4 cpu-idle(last 10s)=80%

The runnable count stayed at 1 or 2, the CPUs sat almost entirely idle, and the load climbed as if four programs were fighting over the cores. The model, starting from 1.24, 1.93 and 1.14 with four tasks counted, predicts 3.39, 2.47 and 1.40 at 90 seconds. Measured: 3.46, 2.49, 1.42. After fsfreeze -u the D count dropped to zero and the 1-minute figure fell to 2.47 within twenty seconds.

The two runs ended near the same load with opposite meanings. The first box was out of CPU. The second had CPU to spare and was stuck on storage.

Laptop terminal showing columns of load numbers next to a small server and a stopwatch

Load versus number of cores

The divide-by-cores rule and where it stops working

The usual rule of thumb divides load by the CPU count. The uptime man page states the premise: “Load averages are not normalized for the number of CPUs in a system,” so a load of 1 means a single-CPU system “is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.” On the two-vCPU container, a load of 3.4 in the CPU test meant roughly 1.7 tasks per core, with work waiting in line.

The frozen-filesystem run breaks that arithmetic. The same division gives 1.7 per core there too, and the CPUs were 98% idle. Dividing by cores tells the truth only when the load is mostly runnable tasks, and the load average alone can’t say whether it is. nproc gives the core count; the D-state count from ps -eo stat | grep -c '^D' gives the other half.

Gregg’s recommendation is to look past the load average for anything that matters. He suggests per-CPU utilization with mpstat -P ALL 1, per-process CPU with pidstat 1, and run queue length from the r column of vmstat 1, and writes that “The best CPU saturation metrics are measures of run queue (or scheduler) latency.” For finding which function is burning the CPU once a hog is identified, the Python profiling guide covers py-spy, which attaches to a running process.

Where people get burned

Alerts on the wrong number, and a hung mount that looks like a CPU fire

Paging on load alone. An alert at “load above number of cores” fires for the frozen-filesystem case as hard as for a real CPU shortage. Someone gets woken up, logs in, sees idle CPUs in top, and decides the alert is broken. The alert was right that something was wrong and useless about what.

NFS and other network mounts. The nfs(5) man page says that with no option set, or with hard, “NFS requests are retried indefinitely.” Every process that touches a hung hard mount joins the uninterruptible queue, including shells that happen to run ls or df against it. This container had no NFS server to test against, so the numbers here come from the fsfreeze stand-in, but the mechanism in the kernel is the same D state the test produced.

Killing the D-state processes. A separate run on a fresh frozen test filesystem sent kill -9 to a blocked dd:

  PID STAT WCHAN                COMMAND
 2935 Ds   percpu_rwsem_wait    dd
3 s after kill -9:
 2935 Ds   dd
after thaw:
 2935 Zs   dd

SIGKILL changed nothing while the filesystem stayed frozen. The process died only after fsfreeze -u let the kernel finish with it, and it showed up as a zombie on its way out. The fix is upstream: thaw the filesystem, restore the network path, replace the failing disk.

Reading the 15-minute number as current. From the calculation above, a load of 4 that stops instantly still shows above 0.5 on the 15-minute figure for over half an hour. Comparing all three numbers gives direction: 1-minute above 15-minute means getting worse, below means recovering.

Memory pressure that looks like CPU. A machine short on RAM can spend its time reclaiming pages and waiting on swap I/O. Urlichs’s 1993 email named swapping explicitly. Compressed RAM changes that picture, covered in the zram and zswap guide, and when reclaim fails the OOM killer explainer picks up where this leaves off.

Water tank filling from a hose while slowly leaking at the bottom onto a concrete floor

The case for keeping it, and what replaces it

A crude number that has outlived better ones

The strongest defense of the Linux load average is Urlichs’s own: “The point of “load average” is to arrive at a number relating how busy the system is from a human point of view.” A box with hung storage is not fine just because its CPUs are idle, and a metric that counts only CPU would have shown the frozen-filesystem test as a quiet machine. By including uninterruptible tasks, Linux made the number worse at diagnosis and better at saying “something is stuck.”

Linux 4.20, released on December 23, 2018, added pressure stall information. Kernelnewbies describes it as “a way to quantify resource pressure in the system.” The kernel documentation splits it by resource in /proc/pressure/cpu, memory and io, where the “some” line shows “the share of time in which at least some tasks are stalled on a given resource” and “full” the share when all non-idle tasks are stalled at once. On the test container, the io file read:

some avg10=0.83 avg60=1.34 avg300=1.92 total=25866286
full avg10=0.78 avg60=1.19 avg300=1.51 total=20123767

PSI answers the question the load average blurs: which resource is everyone waiting on. It still doesn’t say why. The load average will go on sitting in the corner of every top screen, a single number that once meant CPU and now means “busy, somehow.” On your own machines, which does the paging alert watch?

Sources

  • proc_loadavg(5) man page: https://man7.org/linux/man-pages/man5/proc_loadavg.5.html
  • Linux kernel source, kernel/sched/loadavg.c: https://github.com/torvalds/linux/blob/master/kernel/sched/loadavg.c
  • Linux kernel source, include/linux/sched/loadavg.h: https://github.com/torvalds/linux/blob/master/include/linux/sched/loadavg.h
  • Brendan Gregg, “Linux Load Averages: Solving the Mystery” (2017): https://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html
  • fsfreeze(8) man page: https://man7.org/linux/man-pages/man8/fsfreeze.8.html
  • uptime(1) man page: https://man7.org/linux/man-pages/man1/uptime.1.html
  • nfs(5) man page: https://man7.org/linux/man-pages/man5/nfs.5.html
  • Kernelnewbies, Linux 4.20: https://kernelnewbies.org/Linux_4.20
  • Linux kernel documentation (v6.6), PSI – Pressure Stall Information: https://www.kernel.org/doc/html/v6.6/accounting/psi.html

487 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *