Stop struggling to find what hogged your CPU while you were at lunch
Process & Resource Monitoring (Top/Htop/Ps/Systemd)
Stop struggling to find what hogged your CPU while you were at lunch
🧩 The Challenge
You come back to your desk and notice the server fans are screaming like a jet engine, but by the time you run top, the load average has already dipped back to normal. It is infuriating trying to hunt down a process that is basically playing hide and seek.
💡 The Fix
Use pidstat with a reporting interval to log snapshots of CPU usage over time so you can actually see what was chewing cycles before you sat down. It beats staring at a static process list hoping for a lucky break.
pidstat -u 5
⚙️ Why It Works
Setting a delay interval forces the tool to gather cumulative statistics across samples instead of just showing you a single, misleading point in time. It effectively paints a historical picture of process activity rather than a snapshot.
🚀 Pro-Tip: Pipe the output to a file and grab a coffee; let the terminal do the surveillance work for you.
Linux Tips & Tricks | © ngelinux.com | 11/18/2026
