Process & Resource Monitoring (Top/Htop/Ps/Systemd)
See what your process is actually waiting on without guessing
🧩 The Challenge
You have a process sitting at 0% CPU but it’s still not responding, and top is being totally useless by just showing it in a sleeping state. I’ve wasted hours staring at load averages trying to figure out why a service is hung when the hardware looks perfectly healthy.
💡 The Fix
Use the task state column in ps to look for the Uninterruptible Sleep status, which usually means your process is stuck waiting on disk I/O or a kernel lock. This tells you instantly if the issue is in your code or if the storage layer is currently melting down.
ps -eo pid,stat,cmd --sort=-stat | grep 'D'
⚙️ Why It Works
The D state in the ps output represents an uninterruptible sleep, which is the kernel’s way of saying the process is blocked on a hardware request that cannot be interrupted by signals. Seeing this confirms your bottleneck is I/O related rather than a logic bug in your application.
🚀 Pro-Tip: If you see a ton of these D states popping up simultaneously, stop poking the process and go check your NFS mounts or disk controller logs immediately.
Linux Tips & Tricks | © ngelinux.com | 12/2/2026
