Process & Resource Monitoring (Top/Htop/Ps/Systemd)
Quit guessing if that single process is *actually* busy
đź§© The Challenge
You’re troubleshooting an app, a database, whatever, and it feels sluggish. You jump into `top` or `htop`, but that one PID you’re watching just flashes by, percentages bouncing all over the place. Or you check `ps aux`, and yeah, it shows some CPU or memory, but how has it been doing for the last five minutes? It’s impossible to spot intermittent spikes or slow memory creep this way.
đź’ˇ The Fix
Stop squinting at those snapshots. There’s a tool that gives you a continuous, focused view of a *single* process’s CPU, memory, and even I/O trends right on your terminal. It’ll show you exactly when that process decides to gobble resources.
pidstat -u -r -d -p 12345 5 10
⚙️ Why It Works
This command taps into the kernel’s process accounting data for the specific PID you give it. It collects and displays CPU usage (`%usr`, `%system`), memory faults (`minflt/s`, `majflt/s`, `VSZ`, `RSS`), and disk I/O (`kB_rd/s`, `kB_wr/s`) at a set interval, allowing you to see resource consumption patterns over time instead of just momentary snapshots.
🚀 Pro-Tip: Don’t have `pidstat`? It’s usually part of the `sysstat` package. `yum install sysstat` or `apt install sysstat` will get you there.
Linux Tips & Tricks | © ngelinux.com | 11/10/2026
