Recipes
Four everyday sittings, each one the shape of a real use of btop. The recipes assume chapters 3 to 5: you can read the boxes, sort and filter, and stop a process safely.
The runaway process
Symptom: the fan, the heat, the
slowness. Open btop and look at box 1
first — if the total is near the top
for minutes, the machine is genuinely
busy rather than merely warm. Then
box 4: it is sorted by processor use
out of the box, so the top row is the
prime suspect. Before acting, press
Enter on it and read its full command
line; a familiar name with an unfamiliar
argument is a different problem from a
name you do not recognise at all. If
it is yours to stop, filter to it (so
the row cannot move under you),
t, read the confirmation's PID line,
Yes, and confirm with ps. If it
restarts, open the tree: you have
stopped a child, and the parent — the
row one branch above — is the real
conversation.
The memory hog
Symptom: programs closing, the machine
crawling without the processor seeming
busy. Sort by memory (Right until the
header reads ← memory →) and read
the MemB column: memory problems show
as one number far above its neighbours.
Check box 2's Available line — if it
is small while Cached is large, the
machine is lending its memory well and
the diagnosis is elsewhere; if
Available itself is small, something is
really holding it. The lab's own hog,
a program holding a 200 MB block, read
205M against neighbours of a few
megabytes: that shape, one row out of
line, is what you are looking for.
Stopping a hog frees memory at once;
stopping the cache is never a job
btop does, because the system reclaims
cache itself the moment it is needed.
The slow download
Symptom: a file that should have
arrived by now. Press 1, 2, 4 to
hide everything but the network box
(and 3 stays — it is the network
itself), and watch the download rate
and its Top figure. A rate hovering
near zero while Top shows the transfer
was once fast says the far end, or the
route, has stalled — not your machine.
A rate that climbs steadily says wait.
While you watch, b and n move
between interfaces if your machine has
more than one, and the box header names
the one in view: checking the wrong
interface is the classic version of
this recipe done wrong.
The small terminal
Symptom: you are on a machine reached
through a cramped window, or over a
slow link, and the four-box screen is
illegible. Three settings, in
ascending order of plainness: a preset
that keeps only the box you need
(chapter 7); the --tty command-line
flag, which forces the plain ANSI graph
symbols and 16 colours, trading the
pretty braille for ink any terminal
renders; and the built-in TTY theme
(chapter 6), which is the same idea
kept permanently in the config file.
On the lab's wide terminal, the block
graphs of preset 3 were the readable
middle step — the same numbers as
chapter 3's braille, in heavier ink.
If btop still complains the terminal is
too small, it is telling the truth:
make the window bigger, or hide boxes
with the number keys until one box
fits, rather than squinting at a
screen that cannot fit what you asked
for.