When a Linux server’s CPU sits at 100%, everything slows down — websites time out, SSH lags, and monitoring starts screaming. High cpu usage linux problems are not solved by rebooting and hoping; they are solved by identifying which process is consuming the CPU and why. This guide gives you the diagnostic workflow professionals use, from the first 60 seconds to the permanent fix. This article covers How to Diagnose and Fix High in detail.
Step 1: Read Load Average the Right Way – How to Diagnose and Fix High
Start with the big picture:
uptime
top
The three load averages (1, 5, 15 minutes) mean trouble only relative to your core count — check with nproc. A load of 8 on an 8-core server is busy; the same load on 2 cores is a meltdown. Inside top, note the CPU breakdown line: us (user processes), sy (kernel), wa (iowait), and st (stolen by the hypervisor — common on oversold VPS plans).

Step 2: Identify the Process Eating the CPU – How to Diagnose and Fix High
Sort processes by CPU usage and capture a snapshot:
ps aux --sort=-%cpu | head -15
top -b -n 1 | head -20
Common offenders fall into recognizable groups: a PHP-FPM pool saturated by traffic or bots, a MySQL server grinding through unindexed queries, a runaway backup/compression job, a Java application, or — the one nobody wants — a crypto miner dropped in by an attacker (unfamiliar process names running from /tmp or /dev/shm are a red flag). For a continuous view with history, a monitoring agent helps enormously; see our guide to real-time monitoring with Netdata.
Step 3: Separate Real CPU Work from I/O Wait
If wa (iowait) dominates, your CPU is not busy — it is waiting on a slow or failing disk, and killing processes will not help. Confirm with:
iostat -x 2 5
vmstat 2 5
High %util and long await times in iostat point to disk problems: a dying drive, a RAID rebuild, or a workload writing far beyond the disk’s ability. Fix storage first.
Step 4: Profile the Guilty Process
Once you know the process, learn what it is doing before touching it:
pidstat -u -p <PID> 2 5 # per-process CPU over time
sudo strace -p <PID> -c -f # what syscalls it burns time on (briefly!)
ls -l /proc/<PID>/cwd /proc/<PID>/exe # where it lives and runs from
For PHP sites, enable the PHP-FPM slow log and status page; for MySQL, run SHOW FULL PROCESSLIST; and check the slow query log — one missing index can pin every core. For scheduled jobs, inspect crontab -l and /etc/cron.d/: backup, antivirus and update jobs stacked at the same minute create a predictable daily spike.
Step 5: Apply the Fix — Short Term and Real
Immediate relief, in order of preference: fix the configuration causing the loop (bad plugin, broken query), reschedule or stagger cron jobs, add swap if the box is also memory-starved (our swap creation guide covers it), or as a last resort restart/renice the process:
sudo renice +10 -p <PID> # lower its priority
sudo systemctl restart <service> # controlled restart
sudo cpulimit -p <PID> -l 50 # cap at 50% of one core
If you found a miner or an unknown binary in /tmp, treat it as a security incident, not a performance issue: preserve the evidence, audit accounts and keys, and rebuild trust in the machine before returning it to service.
Step 6: Prevent the Next Spike
Graph CPU, load and iowait so spikes have timestamps you can correlate with cron schedules and traffic; alert at sustained 85% rather than at total saturation. Keep an eye on memory too — our article on how to check RAM on Linux pairs well with this workflow. The top and vmstat fields used above are defined in the procps documentation.
The Five-Minute Triage Card
When you get the 3 a.m. alert, run these in order. One: uptime — is load above core count, and for how long (compare the three averages)? Two: top — which single process leads, and is the time us, sy or wa? Three: ps aux --sort=-%cpu | head — is the leader a known service or a stranger? Four: free -h and df -h — is the box also swapping or disk-full, which masquerades as CPU trouble? Five: journalctl -n 50 and the service’s own log — did something start error-looping at the spike’s timestamp? These five commands take under five minutes and correctly classify the overwhelming majority of incidents into application bug, traffic surge, I/O problem, cron pile-up or intrusion — and each class has a different correct response, which is why guessing first and measuring later always costs more time.
Conclusion
Fixing high cpu usage on a Linux server is a process, not a guess: measure load against core count, name the process, distinguish real work from iowait, profile before you kill, and then fix the cause — a query, a cron pile-up, a plugin, or an intruder. With monitoring in place, the next spike becomes a notification instead of an outage.