Part 1 · 1 chapters · ~8 min

CPU

CPU utilisation by mode, saturation and run queues, load averages on Linux (which include uninterruptible I/O waits), per-CPU imbalance, scheduler latency, IPC and cycles per instruction with perf stat, CPU frequency and steal time, and cgroup throttling.

2

Utilisation, saturation, efficiency

code
mpstat -P ALL 1                     # CPU 3 at 100% usr, others idle → a single-threaded hot path
vmstat 1                            # r = 14 on an 8-CPU box → saturated
cat /proc/pressure/cpu              # some avg10=35.00 → tasks waited for CPU 35% of the last 10 s
perf stat -a -- sleep 10            # cycles, instructions, IPC, context switches, migrations
#   insn per cycle 0.62 → stalled on memory more than computing
runqlat-bpfcc 10 1                  # histogram of scheduler queue latency (part 7)

Linux load averages count runnable tasks plus tasks in uninterruptible sleep (usually disk I/O), so a high load can mean slow disks, not busy CPUs. Always check vmstat r and wa, or PSI, before concluding CPU is the problem.

CPU: WHAT TO CHECK
from utilisation to cycles per instruction
utilisationmpstat per CPU: user, system,iowait, steal, irq.saturationRun queue length (vmstat r), PSIcpu, scheduler latency.whopidstat and top: which process andthread.whereperf profiles and flame graphs:which functions.how wellIPC from perf stat: stalls onmemory or branches.limitscgroup throttling and steal timefrom noisy neighbours.
swipe the figure sideways, or tap expand for full screen
1/5
utilisation by type
High user time is your code; high system time is syscalls or kernel work; steal means the hypervisor gave your CPU to someone else.
user, sys, steal, iowaiteach points somewhere else