Run top or ps sorted by CPU to find the process responsible, then check whether the time is user (application code) or system (kernel work such as networking or syscalls). Most sustained high CPU comes from an application bug, too much traffic, a heavy scheduled job or an unexpected process such as a crypto miner.
Symptoms
- CPU at or near 100% in top or your monitoring
- Slow responses and rising latency
- Fans loud or CPU temperature rising on physical hardware
How to diagnose it
Find the top processes
%CPU above 100 means a process is using more than one core.
ps -eo pid,ppid,user,%cpu,%mem,etime,cmd --sort=-%cpu | head -15Check the CPU breakdown
us is application code, sy is kernel time, wa is waiting on I/O, st is time stolen by the hypervisor. Press 1 in top to see each core.
topPer-core usage over time
Shows whether one core is pinned (a single-threaded process) or all cores are busy.
mpstat -P ALL 1 5 # from the sysstat packageFind what started it
Check the parent process, the service unit and when it started.
ps -o pid,ppid,lstart,cmd -p PID systemctl status PIDCheck where the binary lives
A process running from /tmp, /dev/shm or a deleted file is suspicious.
sudo ls -l /proc/PID/exe
Common causes and fixes
Application bug or infinite loop
Restart the service to restore capacity, then profile it (py-spy, perf, a language profiler) to find the hot code path.
sudo systemctl restart SERVICETraffic spike or bots
Check web server access logs for the top client IPs and paths, then rate-limit or block abusive clients.
sudo awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | headHeavy cron or backup job
Reschedule it off-peak and run it at lower priority.
nice -n 19 ionice -c3 /path/to/backup.shCrypto miner or other malware
A random-named process at full CPU, especially from /tmp, is a common sign of compromise. See the crypto miner guide before killing it.
High system time from networking or interrupts
Check softirq time in top (si) and network packet rates; very high packet rates can point at a flood or a misconfigured service.
Prevent it happening again
- Alert when CPU_overall is above 90% for 10 minutes.
- Keep top-process history so a past spike can be traced to a process without having been logged in.
- Use Statance security monitoring to flag likely miners and binaries running from /tmp or deleted files.
Set it up: Linux monitoring · Ubuntu monitoring · Debian monitoring.
FAQ
How do I find which process is using the most CPU in Linux?
Run ps -eo pid,user,%cpu,cmd --sort=-%cpu | head, or open top and press P to sort by CPU.
Is 100% CPU usage bad?
Brief spikes are normal. Sustained 100% means requests queue and latency rises, so investigate anything lasting more than a few minutes.
Why does top show more than 100% CPU for one process?
top reports per-core percentages, so a process using four cores fully shows 400%.
Related guides
Get alerted before this becomes an outage.
Install the agent in one line. Statance watches CPU, memory, disk and services, and its AI assistant helps find the cause.