Stop wondering why your CPU usage spikes when nothing is happening
Process & Resource Monitoring (Top/Htop/Ps/Systemd)
Stop wondering why your CPU usage spikes when nothing is happening
🧩 The Challenge
Everyone has dealt with that one server that acts like it’s busy but top shows nothing useful, usually because some tiny process is thrashing the CPU for a fraction of a second at a time. It’s maddening when your load average is climbing and you can’t pin it to a single offender.
💡 The Fix
Use pidstat with a sampling interval to capture the short-lived processes that usually slip through the cracks of standard monitoring tools. This gives you a clear window into what’s actually chewing up cycles over a set period.
pidstat -u 2 5
⚙️ Why It Works
Setting the interval to two seconds and repeating it five times forces the kernel to report process-level CPU usage that happens between your standard one-second refreshes. It effectively catches the ghosts that vanish before your eyes in top or htop.
🚀 Pro-Tip: Pipe it into awk if you need to aggregate total CPU usage per command name across a busy cluster.
Linux Tips & Tricks | © ngelinux.com | 11/22/2026
