Cloud & Operations · Practical News

How to Diagnose 100% CPU on a Server: From top to Root Cause

Source: Paddy Dance teamKeywords: how to diagnose 100% CPU on a server

Confirm the symptom first: really maxed out, or a monitoring false alarm

Run top on the server and read the us, sy, and wa values on the %Cpu(s) line: high us usually means application computation, high sy suggests frequent system calls, and high wa points to waiting on disk I/O rather than the CPU itself. Press 1 to expand per-core usage and see whether every core is saturated or only one. These directions lead to completely different fixes, so look before you act.

Then check load average with uptime; if the load is far above the number of CPU cores, tasks are queuing. Record these values and the time they occurred, and compare them with any recent deployment, batch job, or traffic surge. This is a prerequisite for judging business impact: if it can wait for off-peak hours, there is no need to take risks immediately, and frequent restarts with an unknown cause are worse.

Pinpoint the process: top, ps, and threads

In top, press P to sort by CPU and note the PID and COMMAND of the top consumer; then run ps -fp PID to see the full command line and identify which service it belongs to. If it is a process you do not recognize, do not kill it. Check its path and running user first, and use ls -l /proc/PID/exe if needed to see where the executable comes from and confirm it is not a critical system process.

For multi-threaded services such as Java or Go, use top -H -p PID to see which thread is consuming CPU, convert the thread ID to hexadecimal, and match it against the application thread stack to reach the specific code path. This step requires human judgment about process ownership; an AI cannot tell you whether a process can be stopped. Stopping the wrong one means an outage, so the decision must be made by someone who understands the business.

Contain the damage and find the root cause: confirm impact first

After identifying the process, decide how to handle it: a business process can often be recovered with rate limiting, a service restart, or a rollback of the latest release; an abnormal process should be isolated after preserving evidence, not by deleting its files. Confirm with you which functions may be briefly interrupted, then use top and curl to verify that CPU has dropped and the business has recovered.

If high wa is masking as high CPU, investigate the disk rather than killing processes: use df -h to check partitions and iostat to check disk utilization, and see whether logs have filled the disk or the database is flushing heavily. Record this diagnostic order and the commands as a reusable high-CPU checklist so the next incident follows a known path instead of trial and error.

FAQ

What do high us and high wa mean in top?

High us means the CPU is mostly spent on user-space application computation, so focus on business processes. High wa means the CPU is waiting on disk I/O and the real bottleneck is the disk, so use df -h and iostat rather than killing processes. A wrong diagnosis makes every later step useless and can make the problem worse.

CPU is high but I do not recognize the process. What now?

Do not kill it yet. Use ps -fp PID to see the full command line, then ls -l /proc/PID/exe to see where the executable points and confirm whether it is a system service or monitoring agent. If you are unsure, preserve the evidence and take screenshots, and let an engineer determine ownership before acting; killing a system process can cause server or business failure.

How long does high-CPU troubleshooting take?

It depends on whether the symptom is reproducible. Common cases can be traced to a process fairly quickly through top, ps, and logs; intermittent spikes need repeated observation with monitoring and a timeline. We respond under the contract, judge business impact first, and do not promise unverified fixed durations or exaggerate how fast we work.

Related questions

What to do about high CPU usageSteps to troubleshoot maxed-out server CPUHow to read CPU in the top commandHow to handle an unfamiliar high-CPU process

Further reading

Sources & References

The following are public sources. Always check the latest requirements on the official authority or platform page.

Explain your case first, then confirm the scope

Tell us your entity, business model and current progress. We will confirm what we can assist with and what you need to do before discussing fees.