Stop hunting for zombie threads that inflate your process count
Process & Resource Monitoring (Top/Htop/Ps/Systemd)
Stop hunting for zombie threads that inflate your process count
🧩 The Challenge
Sometimes you look at htop and see a process listed as running with hundreds of threads, but you have no clue if they’re actually doing work or just sitting there eating your PID limit for breakfast. It’s infuriating when you’re trying to debug a service that seems sluggish but the CPU load looks totally fine.
💡 The Fix
Use the specific command to filter and display the thread count per process directly in your output. You’ll be able to spot runaway multi-threaded apps in seconds instead of digging through procfs files manually.
ps -eLf --sort=-nlwp | head -n 20
⚙️ Why It Works
The L flag tells ps to show individual threads, and sorting by nlwp (number of light-weight processes) puts the heavy hitters at the top of your terminal. It’s way faster than refreshing a monitor and guessing which process is spawning tasks like a rabbit.
🚀 Pro-Tip: Alias this to ‘ps-threads’ in your bashrc so you aren’t fighting to remember the flags when a server starts hanging.
Linux Tips & Tricks | © ngelinux.com | 11/3/2026
