How to Diagnose High Load with Low CPU on Linux: Tools & Tips
This guide explains how to analyze Linux load situations—whether CPU and load are both high or CPU is low while load remains high—by using commands like top, vmstat, iostat, sar, and jstack, and provides practical troubleshooting steps for common I/O‑related issues.
Common Load Analysis Methods
High CPU & High Load
Use top to find the PID of the process consuming the most CPU.
Run top -Hp PID to locate the thread (TID) with the highest CPU usage within that process.
For Java applications, execute jstack to print thread stack information.
Use printf %x tid to display the hexadecimal ID of the most CPU‑intensive thread.
Low CPU & High Load
The root cause is typically many processes waiting for disk I/O, which inflates the load average while CPU remains idle.
Check CPU I/O wait time with top (field %wa ).
Inspect disk I/O statistics using iostat -d -x -m 1 10 (install with yum install -y sysstat if needed).
View network I/O via sar -n DEV 1 10 .
Identify I/O‑heavy processes with: <code>ps -e -L h o state,cmd | awk '{if($1=="R"||$1=="D"){print $0}}' | sort | uniq -c | sort -k 1nr</code>
High CPU & High Load Analysis
Use vmstat to view system‑level CPU load.
Use top to view process‑level CPU load.
2.1 Using vmstat to View System‑Level CPU Load
vmstat -n 1refreshes the statistics every second.
<code>[root@VM-1-14-centos ~]# vmstat -n 1
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 250304 163472 2154300 0 0 1 16 0 4 1 0 98 0 0
... (output truncated) ...</code>Key columns:
r : Number of processes waiting for CPU; a high value indicates a long run queue.
b : Number of blocked processes.
us : Time spent in user space.
sy : Time spent in kernel space; high values suggest heavy system calls or I/O.
wa : Percentage of CPU time spent waiting for I/O; high values point to I/O bottlenecks.
id : Percentage of idle CPU time; consistently low while
syis double
usmay indicate CPU shortage.
Common issues and solutions:
If
rfrequently exceeds 4 and
idstays below 40, the CPU is heavily loaded.
If
piand
poare non‑zero for long periods, memory is insufficient.
If disk I/O counters are non‑zero and the
bqueue exceeds 3, I/O performance is poor.
2.2 Using top to View Process‑Level CPU Load
topshows per‑process CPU and memory usage.
<code>top - 19:49:59 up 36 days, 23:15, 3 users, load average: 0.11, 0.04, 0.05
Tasks: 133 total, 1 running, 131 sleeping, 0 stopped, 1 zombie
%Cpu(s): 3.1 us, 3.1 sy, 0.0 ni, 93.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
... (output truncated) ...</code>Press
Pin the interface to sort processes by CPU usage descending, then investigate the top consumers using logs.
Low CPU & High Load
Problem Description
Linux shows an idle CPU but a very high load average.
Analysis
Many processes are blocked waiting for disk I/O, inflating the load average while CPU remains idle. Typical scenarios include:
1. Excessive disk read/write requests causing I/O wait.
2. MySQL queries without indexes or deadlocks leading to I/O blockage.
3. External storage failures (e.g., NFS server down) causing prolonged I/O waits.
Remediation
Load average reflects the length of the task queue; a high value signals many waiting tasks.
Check for uninterruptible (D) state processes with
ps -axjf.
D‑state processes cannot be killed; resolve by restoring dependent resources or rebooting.
<code>ps -e -L h o state,cmd | awk '{if($1=="R"||$1=="D"){print $0}}' | sort | uniq -c | sort -k 1nr</code>Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.