htop and btop: what's happening on the machine right now
How to view a live picture of processes, CPU, and memory, which columns matter, and why full-screen programs should be run on the “Screen” and not in the text console.
Updated August 23, 2026
When a machine starts behaving strangely, the first question is who is eating resources right now. htop and btop answer it: both programs show processes, core load, and memory in real time.
Installation
apt update && apt install -y htop btop # Debian, Ubuntu
dnf install -y htop btop # AlmaLinux, CentOS Stream
In older AlmaLinux 9 repositories the btop package may be missing — enable EPEL (dnf install -y epel-release) and repeat the installation.
It's more convenient to run these programs over SSH or on the “Console” tab in “Screen” mode (VNC). The text console works over a serial port, and it doesn't transmit the window size: it's always 80×24 there, and the btop interface falls apart or refuses to render. For more details, see Machine console.
What to look at in htop
The top block shows bars for each core, memory, and swap. On VDS-1 there's one bar, on VDS-6 there are ten. Below is the process table; the key columns:
CPU%— the share of a single core. 100% means a fully busy core, not the whole machine: on four cores the ceiling is 400%.MEM%— the share of the tier's RAM.RES— how much is actually occupied in memory. Go by it, not byVIRT: the virtual size of a JVM and databases is always huge and means nothing.S— state.R— running,S— sleeping,D— waiting on disk,Z— zombie.
Useful keys: F6 — sorting (usually by CPU% or MEM%), F4 — filter by name, F5 — process tree (you can see who spawned whom), F9 — send a signal, q — quit.
Many processes in state D — the disk is the bottleneck, see disk load. High load average with low CPU% — same story.
btop and one-off checks
btop shows the same thing plus CPU, network, and disk graphs for the last few minutes. It's heavier and requires a proper terminal, but it immediately shows whether there was a spike or the load is holding steady.
When a terminal is inconvenient, one-off commands are enough:
ps aux --sort=-%cpu | head -10 # ten most CPU-hungry processes
ps aux --sort=-%mem | head -10 # by memory
uptime # average load for 1, 5 and 15 minutes
Common mistakes
- Judging load from a single frame. A spike at the moment htop starts is normal. Watch for a minute or check the graphs in the “Overview” of the panel
/hosting/vds/m/<id>. - Killing a process with
kill -9right away. First use a regularkill(the TERM signal) orsystemctl stopso the service closes its files and connections.-9is a last resort. - Confusing “little free memory” with a memory shortage. Linux gives free memory to the cache, that's normal. A warning sign is growing swap, covered in the article Memory and swap.
If htop won't open because the machine no longer responds over SSH, use the “Console” in the panel — it works even with an overloaded network and a full disk.