High CPU Usage on Linux: Find the Cause and Fix It
Your application was responsive yesterday. Now requests are timing out, SSH commands feel slow, and CPU usage is hovering near 100%. Restarting the VPS might make the graph look better temporarily, but it will not explain what happened.
High CPU usage on Linux is a symptom. The real problem could be a busy application worker, an infinite retry loop, overlapping cron jobs, a container without sensible limits, or contention on the VPS host.
This guide focuses on finding the cause and choosing a safe fix. If you only need an overview of server metrics, start with our separate guide, How to Monitor a Linux VPS Without the Terminal (add the verified published URL before posting).
1. Confirm that CPU is the bottleneck
A CPU graph at 100% does not automatically mean the server is broken. Compilation, backups, and legitimate traffic spikes can briefly use all available processing power.
Start with:
uptime
nproc
top
uptime shows load averages over approximately 1, 5, and 15 minutes. nproc reports the processing units available to the current process. Neither is a direct CPU percentage: Linux load average also counts tasks in uninterruptible sleep, often waiting on I/O.
Inside top, pay attention to:
usandsy: CPU time spent executing user-space and kernel work.wa: time the CPU is idle while the system has outstanding I/O requests; investigate storage rather than assuming CPU execution is the problem.st: time taken by the hypervisor from a virtual CPU; sustained high values can point to host contention on a VPS.
If the machine is slow but CPU execution is low, inspect memory and disk activity before treating this as a CPU incident:
free -h
vmstat 1 5
A heavily swapping server can appear unresponsive even when the CPU is not the primary bottleneck.
2. Identify the process—and what started it
Use top and press P to sort by CPU usage. For a second view:
ps -eo pid,ppid,user,stat,etime,%cpu,%mem,args --sort=-%cpu | head -n 15
The PPID column identifies a process’s parent; etime shows how long it has been running. These details help distinguish a short-lived deployment task from a worker that has been spinning for hours.
Inspect a suspicious PID:
ps -p 1234 -o pid,ppid,user,stat,etime,%cpu,%mem,args
Replace 1234 with the real PID. Note that ps reports CPU usage averaged over the process’s lifetime; top is better for observing a current spike.
Ask which service, container, scheduler, or application owns the process. Do not terminate it simply because it is at the top of the list. A database query or backup may be consuming CPU for a legitimate reason.
3. Check for an application loop or runaway worker
An infinite loop is an obvious culprit, but repeated failures can have the same effect. A queue worker that immediately retries a failing job, an API client without backoff, or an application that spawns too many workers may saturate a small VPS.
If the process belongs to a systemd service, inspect recent logs:
sudo systemctl status myapp.service
sudo journalctl -u myapp.service --since "30 minutes ago" --no-pager
Look for the same exception appearing hundreds of times, rapid worker restarts, repeated connection failures, or an unexpected increase in concurrency. Correlate the first error with the time CPU usage rose.
Fix the mechanism, not just the process: add retry delays, correct the failing dependency, reduce worker concurrency, optimize expensive queries, or roll back a faulty release after confirming the deployment caused the regression.
For more on service inspection, see How to Manage Systemd Services on Linux (insert its verified published URL).
4. Find overlapping cron jobs
A task that normally finishes in two minutes can become a CPU problem if it runs every minute. Each new invocation may start while the previous one is still working.
Inspect the current user’s scheduled jobs:
crontab -l
Also review the appropriate system crontabs and timers for your distribution and deployment. On systemd-based systems, list timers with:
systemctl list-timers --all
If the CPU spike appears at predictable times, compare those timestamps with job logs and process start times. A locking strategy, longer schedule interval, smaller batch size, or concurrency limit may prevent overlap.
Do not disable an unfamiliar scheduled task until you know whether it handles backups, renewals, or other essential maintenance.
5. Determine whether Docker is responsible
When several applications share one VPS, the busiest host process may belong to a container. Start with:
docker stats --no-stream
Then inspect the relevant container’s recent output:
docker logs --tail 100 my-container
Check for crash/retry cycles, expensive background jobs, or a service that scaled beyond the available CPUs. Container CPU percentages must be interpreted alongside the host’s CPU count and the container’s configured limits.
Resource limits can reduce the impact of a noisy container, but they do not fix an inefficient query or application bug. If the container keeps restarting, investigate that failure separately before raising limits.
6. Investigate VPS CPU steal and host contention
Sometimes no guest process explains the slowdown. On a virtual server, the hypervisor schedules virtual CPUs alongside other tenants’ workloads.
In top, watch the st field during the incident. Sustained elevated steal time suggests the VM is waiting for physical CPU time. A short nonzero reading alone is not proof of a hosting problem.
Collect timestamps and repeatable measurements, then contact your VPS provider if the issue persists. Upgrading the guest application or killing processes will not solve sustained host-level contention.
7. Choose the least disruptive intervention
Once the cause is identified, select an action that matches it:
| Finding | Better first action |
|---|---|
| New release triggers a tight loop | Investigate logs; fix or roll back the release |
| Worker repeatedly retries a failed task | Repair dependency; add backoff or reduce concurrency |
| Cron jobs overlap | Introduce locking or change scheduling |
| Docker workload monopolizes CPU | Inspect container; tune workload and appropriate limits |
| Sustained VPS CPU steal | Gather evidence and contact the host |
| Legitimate demand exceeds capacity | Optimize first; consider scaling if needed |
For a confirmed systemd-managed application, a controlled restart may be appropriate:
sudo systemctl restart myapp.service
A restart can interrupt active requests and should follow your deployment or maintenance procedures. If you must signal an individual PID, kill -TERM 1234 requests graceful termination; kill -KILL should be a last resort because it prevents normal cleanup.
Never restart SSH, the database, or an unknown production process solely to lower the CPU graph.
8. Use Server Explorer to narrow down the culprit
Server Explorer is a desktop SSH-based tool for managing Linux servers. Its process monitor displays running processes with identifiers and resource usage, helping you locate a suspicious workload without repeatedly sorting terminal output.
A practical incident workflow is to open the affected server, inspect the process list, identify the PID and owner, then use the integrated terminal and available logs to determine which application or service is responsible. Review the evidence before taking a process action.

Identify the processes behind a CPU spike before taking actionBring your servers into focus.
A desktop app for macOS and Windows. Connect over SSH.
For broader server monitoring—not root-cause analysis—refer to How to Monitor a Linux VPS Without the Terminal (add its published URL). You can also read our guide to managing a VPS without the command line.
A visual process list is a starting point, not an application profiler or a substitute for historical telemetry.
Final thoughts
When a Linux VPS hits 100% CPU, resist the temptation to restart everything. First establish whether the machine is truly CPU-bound, identify the responsible workload, and inspect the logs and recent changes. Then fix the loop, job overlap, resource configuration, or infrastructure issue that caused the spike.
That approach takes longer than pressing Restart once—but it is far more likely to keep the incident from returning.
Bring your servers into focus.
A desktop app for macOS and Windows. Connect over SSH.