Skip to content

High load with idle CPU: processes in D state, yet the disk is idle

Linuxtested on Ubuntu 24.04, Kernel 6.8

The alert says load above 4 on 4 CPUs, and the ticket asks for more CPUs. But the CPUs have nothing to do: Linux also counts processes that wait uninterruptibly for I/O. The question is what they are waiting for.

Symptom

uptime
 23:05:33 up 10:04,  1 user,  load average: 4.51, 3.72, 3.09

vmstat 1 3
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st gu
 0  6      0 11923800   5304 116016    0    0  2048     0  152  101  0  0  0 100  0  0

Nobody wants to compute (r = 0), six processes are blocked (b = 6), the CPUs only wait.

Diagnosis

Who is waiting, and is the disk really busy?

ps -eo state,pid,comm | awk '$1=="D"'
D   74659 dd
D   74660 dd
D   74661 dd

iostat -sxz 1 2
Device             tps      kB/s    rqm/s   await  areq-sz  aqu-sz  %util
sdb               4.00   2048.00     0.00    1.50   512.00    0.01   0.20

Causes

io.max rbps=2000000A read limit in the service's cgroup

The disk is 0.2 % busy and reads a flat 2048 KiB/s – that looks like a limit. The service's cgroup may read at most 2 MB/s from sdb (8:16).

cat /sys/fs/cgroup/system.slice/archivpruefung.service/io.max
8:16 rbps=2000000 wbps=max riops=max wiops=max

PSI io 99 %I/O pressure instead of CPU pressure

PSI confirms it system-wide and in the cgroup – I/O pressure near 100 %, CPU pressure 0.

cat /proc/pressure/io
some avg10=98.96 avg60=75.73 avg300=30.64 total=1020348624
full avg10=98.77 avg60=75.63 avg300=30.33 total=991780918

D stateLoad counts waiting processes too

The load average is not a CPU metric. It counts runnable processes and those waiting uninterruptibly for I/O (D state).

Fix

Remove the limit (here stop the service) and check.
sudo systemctl stop archivpruefung
vmstat 1 2 | tail -1
 0  0      0 11911264   8268 124232    0    0     0     0  252  127  0  0 100  0  0  0

Don't: Order more CPUs as soon as load is high. Read vmstat r against b first – b and wa point to I/O.

▶
Break it yourself and find it – free
Linux system performance hands-on, day 3: where the numbers come from – procfs, sar and PSI, and a load that looked like CPU.
Go to day 3 →

FAQ

How do I tell whether high load comes from CPU or I/O?

In vmstat, r counts processes that want to compute, b blocked ones. High load with b > 0, high wa and low r means I/O.

Why is the disk idle although processes wait for I/O?

Requests are throttled before they reach the disk, for example by a cgroup's io.max. Then only the cgroup's PSI shows the pressure.

Related error patterns

More