One VM sits at 100% CPU and the app on it is slow. How do you find what's actually burning the CPU?
BeginnerTroubleshootingDisk, memory and CPU
Answer
Likely causes → A hot loop, a regex or JSON parse on huge input, a GC storm, a crypto-miner on a compromised box, or simply more traffic than the box can handle.
Diagnose → Narrow from process to thread to function:
top -c # which process; check us vs sy vs st
pidstat -u -p <pid> 1 5
top -H -p <pid> # which thread
sudo perf top -p <pid> # which function (native)
py-spy top --pid <pid> # Python
jcmd <pid> Thread.print # Java: match hot thread id in hex (nid)
An unknown process name or binary in /tmp means treat it as a security incident.
Fix → Roll back if a deploy introduced it, scale out if it's real load, or kill and fix the runaway job.
Prevent → Per-process CPU metrics (process-exporter), continuous profiling (Pyroscope, Parca), and CPU alerts based on saturation, not single spikes.
More on Disk, memory and CPU
The app fails to write with "No space left on device", but `df -h` shows the volume is only 40% used.Beginner`df -h` says `/` is 100% full, but `du -sh /*` only adds up to 30% of the disk.BeginnerA server shows load average 40 on 8 cores, but `top` shows CPU 60% idle and the app is crawling.BeginnerPods are being evicted with "The node was low on resource: ephemeral-storage. Container app was using 18Gi, which exceeds its request of 0."IntermediateCI build agents running Docker fail with "no space left on device" while pulling images; `/var/lib/docker` is 95% full.IntermediatePostgres on a VM died overnight; `dmesg` shows "Out of memory: Killed process 2314 (postgres) total-vm:..., anon-rss:...".Intermediate