Linux CPU States Explained: Troubleshooting Guide 2026

Linux CPU States

Introduction

“CPU is high” is one of the most common alerts an L1, L2 or L3 production support engineer receives. But that sentence tells you almost nothing about the actual problem.

Is the CPU busy executing application code? Is the kernel consuming CPU resources? Are processes waiting for I/O? Is the hypervisor taking CPU time away from your virtual machine?

Each situation requires a different investigation and potentially a different fix.

The answer starts with understanding Linux CPU states.

In this article, we’ll explore what each CPU state represents, how to identify common CPU troubleshooting patterns, and the mistakes to avoid so you don’t turn a few minutes of investigation into hours of unnecessary troubleshooting.

What Are CPU States?

At any moment, each CPU core spends time performing different activities. Linux maintains cumulative CPU time counters for these activities and exposes them through /proc/stat.

Tools such as top, mpstat, vmstat and sar read these statistics and calculate CPU utilization percentages over time.

Here are the eight commonly displayed CPU states:

StateNameMeaning
usUser Time spent executing application code in user space
sySystemTime spent executing kernel code, such as system calls and kernel operations
niNiceTime spent executing user processes with modified nice priority
idIdleTime when the CPU is idle
woI/O WaitTime accounted as idle while outstanding I/O requests exist
hiHardware InterruptsTime spent servicing hardware interrupts
siSoftware InterruptsTime spent processing software interrupts (softirqs)
stStealTime taken away from a virtual CPU by the hypervisor for other workloads

Common CPU Troubleshooting Patterns I’ve Observed in Production

When you receive a high CPU utilization alert or suspect performance issues, the first step is to examine the CPU-state breakdown. This helps you understand where the system is spending its time and determine whether you are dealing with actual CPU saturation or a problem related to another resource, such as disk I/O, interrupts, or virtualization.

With a clear understanding of CPU states, you can easily identify where to start troubleshooting. For example, high %us indicates a potential application-level issue, high %sy points towards kernel or system calls, and high %wa suggests I/O bottlenecks, where you should investigate processes stuck in the D state. This helps you narrow down the root cause instead of blindly troubleshooting.

Over the years of troubleshooting, I’ve noticed several recurring patterns that help me quickly identify CPU-related issues, narrow down the root cause, and resolve incidents faster.

PatternLikely CauseNot NecessarilyNext CommandDecision
High CPU utilizationCompute-bound process,
runaway loop, GC,
legitimate batch, traffic
growth
A fault: batch hosts
may be meant to
run hot
mpstat -P ALL 1 3
top -H
pidstat -u 1 5
One process dominates:
Many moderate ones: capacity or
traffic. Planned batch: check that
nothing waits behind it (r vs
CPUs).
High load, low CPUTasks blocked in D-state:
NFS or storage stall,
kernel lock, swap
A CPU shortagevmstat 1 5
ps -eo
stat,pid,wchan:32,comm |
awk ‘$1~/^D/
D tasks sharing one mount or
device: storage or network
storage path (Disk and Network
guides). Do not add CPU.
High load, high CPUReal saturation, too many
worker threads, noisy co
located job
One bad process: it
may be many
moderate ones
vmstat 1 5
cat /proc/pressure/cpu
pidstat -u 1 5
r above CPUs and PSI rising:
reduce or rate-limit load, fix the
hog, then add capacity.
High iowait
wa elevated, CPUs idle
Slow disk or network
storage, swapping
CPU is busy; or that low wa proves I/O is fineiostat -x 1 3
pidstat -d 1 3
vmstat 1 (si, so)
Device saturated: find the heavy
reader or writer. Swapping:
Memory guide. Remote storage:
Network or Disk guide.
Spikes on a schedule
repeats at fixed times
cron, backup, log rotation,
overlapping job runs
An application
defect
sar -u (time window)
crontab -l; systemctl list
timers
ps at the spike
Match start time to a job.
Overlap: add locking (flock),
stagger, lower priority with nice.
One core at 100%
average looks moderate
Single-threaded hot loop,
IRQs on one core, CPU
pinning
The whole host is
overloaded
mpstat -P ALL 1 3
cat /proc/interrupts
taskset -cp PID
%soft on one core: NIC queue and
IRQ affinity, RSS, irqbalance. %usr
from one process: single-thread
limit, scale out or fix code.

I’ve also created a comprehensive CPU troubleshooting guide that includes decision flows, an RCA template, additional real-world troubleshooting patterns, practical checklists, and commonly used commands. If you want to take your CPU troubleshooting skills further, I highly recommend checking it out here.

We have already covered one of the pattern in our real scenario series where we have discussed in details what we need to check, how to troubleshoot it, RCA Templates, common inerview questions and FAQ you can check it here.

Common Troubleshooting Mistakes

Now that you have a good understanding of CPU troubleshooting, let’s look at some common mistakes that can turn a simple investigation into hours of troubleshooting. These are mistakes I also made during the early days of my troubleshooting journey, and learning from them helped me resolve incidents more efficiently.

MistakeWhy It HappensWhat experienced engineers do
Treating high load average
as proof of high CPU
Dashboards show load next to
CPU. Other Unix systems count
only runnable tasks, but Linux
also counts D-state tasks.
Split running task from blocked in vmstat and count task states
before drawing a conclusion.
Killing or restarting before
collecting evidence
Pressure to restore service
quickly.
Run an evidence-capture script first then mitigate with reversible steps
Ignoring D-state processes,
or trying kill -9 on them
They look like hung processes.Read wchan, find the shared dependency (storage, NFS, lock), fix that. kill -9 cannot
interrupt an uninterruptible wait.
Looking only at current
metrics
Live commands are quick and
feel authoritative.
Pull sar or monitoring history to see when the pattern began and what else changed at that
time.
Forgetting container limitsNode dashboards look healthy.Read cpu.stat and cpu.max, and compare
throttled periods to total periods.
Adding CPU as the first fixScaling is easy to do.Confirm saturation first. Fix the cause, then size
capacity

Conclusion

Understanding CPU states is one of the most important skills when troubleshooting Linux performance issues. Instead of blindly investigating processes whenever you receive a high CPU alert, start by understanding where the CPU time is being spent. As we’ve discussed, different CPU states reveal different types of bottlenecks, and recognizing common production troubleshooting patterns can help you narrow down the root cause much faster.

I’ve also shared some common troubleshooting mistakes that I made early in my career. Avoiding these mistakes, following a structured investigation approach, and learning to interpret system metrics will help you become more confident in handling real-world CPU-related incidents.

If you want a quick reference while working on Linux systems, I’ve also created a Linux Troubleshooting Cheat Sheet covering commonly used commands and troubleshooting techniques. You can get it for free here: Get Your Free Linux Troubleshooting Cheat Sheet.

Remember, effective troubleshooting is not about running more commands; it’s about knowing which command to run, what to look for, and how to interpret the results.

Similar Posts

Leave a Reply

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