The first sixty seconds on a slow server
Ten commands in a fixed order, from uptime to top, that check every major resource on a slow Linux server in about a minute, and what to read in each.
Load average and the USE methodjournald and journalctlMemory, page cache and swapThe OOM killer
The first sixty seconds on a slow server
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- A fixed checklist beats improvising under pressure. Netflix's published sequence is `uptime`, `dmesg | tail`, `vmstat 1`, `mpstat -P ALL 1`, `pidstat 1`, `iostat -xz 1`, `free -m`, `sar -n DEV 1`, `sar -n TCP,ETCP 1`, then `top`.
- Run the interval tools for a few seconds and ignore their first line, which `vmstat` documents as averages since boot.
- `dmesg` catches what the other tools cannot: OOM kills, disk errors, dropped packets and hung tasks.
- In `vmstat`, compare `r` with the CPU count, watch `si`/`so` for swapping, and split CPU time into `us`, `sy`, `wa` and `st`. High `st` means a noisy neighbour on the hypervisor.
- `mpstat` finds one hot CPU hidden by an average, and `pidstat` names the process. `iostat -xz` shows whether a disk is slow (`await`) or simply busy.
- Most of these tools come from the sysstat package. Install it before you need it, and enable its collector so `sar` has history.
A checklist for a bad minute
You get paged: the API is slow. You SSH in, and every second counts. Without a plan, people type whatever comes to mind, see something odd in the first tool, and chase it for twenty minutes. Often the odd thing was there all along and the real problem was elsewhere.
In 2015 Brendan Gregg and Netflix’s performance team published the ten commands they run in the first minute on a Linux instance. It is the USE method turned into keystrokes: each command checks utilisation, saturation or errors for a resource, in an order that moves from broad to specific. Think of it as a pilot’s checklist. Pilots know how to fly. The checklist exists because stress makes people skip steps.
The ten commands
uptime
dmesg | tail
vmstat 1
mpstat -P ALL 1
pidstat 1
iostat -xz 1
free -m
sar -n DEV 1
sar -n TCP,ETCP 1
top
Stop each interval tool with Ctrl-C after five or so lines. The vmstat man page warns that its first line “gives averages since the last reboot”, and the sysstat tools behave the same way, so read the lines after it.
What each one tells you
uptime: the load averages and their trend. If load is far above the CPU count, something is queuing, either for CPU or, on Linux, for disk.
dmesg | tail: the kernel’s recent messages. This is where the OOM killer records its victims and where disk errors, dropped packets and “task blocked for more than 120 seconds” warnings appear. Many distributions restrict dmesg to root, so use sudo or journalctl -k, as in journald.
vmstat 1: the overview, one line per second. In the man page’s terms, r is “runnable processes (running or waiting for run time)” and b is “processes blocked waiting for I/O”. Compare r with the CPU count to judge CPU saturation. si and so are swap-in and swap-out per second. Anything non-zero for a sustained period means memory pressure, as covered in memory, page cache and swap. The CPU columns split time into user (us), kernel (sy), idle (id), waiting for I/O (wa) and stolen by the hypervisor (st). High sy points at the kernel, perhaps lots of syscalls or interrupts. High st on a cloud VM means another tenant is using the physical CPU you thought was yours.
mpstat -P ALL 1: the same split per CPU. An average of 12% can hide one CPU at 100%, which is what a single-threaded process or a single network interrupt queue looks like.
pidstat 1: per-process CPU, a rolling version of top that does not clear the screen, so you can see patterns. pidstat -d 1 gives per-process disk I/O.
iostat -xz 1: extended per-device disk statistics, skipping idle devices. Read r/s and w/s for the workload, r_await and w_await for latency in milliseconds including queueing, aqu-sz for queue length, and %util for how much of the time the device was busy. The next lesson goes into why %util misleads on SSDs.
free -m: memory. Read the available column, not free, since Linux uses spare memory for cache.
sar -n DEV 1: network throughput per interface, rxkB/s and txkB/s, plus %ifutil. Compare against the link speed.
sar -n TCP,ETCP 1: TCP activity. active/s is outgoing connections opened, passive/s incoming. The error report shows failed connection attempts and retransmitted segments. The 2015 article calls the column retrans/s. The current sysstat man page names it retrseg/s. Rising retransmits mean loss somewhere between you and the peer.
top: finally, the familiar view from processes, ps and top, now that you know what to look for in it.
Before you need it
mpstat, pidstat, iostat and sar come from the sysstat package, which is often not installed on minimal images. Install it on every server ahead of time. sar can also report the past, but only if the sysstat collector has been recording. The man page says daily files go to /var/log/sa (Debian uses /var/log/sysstat). Enable the sysstat service, and “what was happening at 03:00?” has an answer.
None of these commands exist on macOS, and there is no Linux machine here, so nothing was run. The command list comes from the Netflix article as listed on Gregg’s site and in his slides. Field meanings come from the vmstat, mpstat, iostat and sar man pages on man7.org, read 2026-11-28.
About the video
The embed is all of grobelDev’s “Linux Performance Troubleshooting Demos”, April 2020, about 11 minutes. Its description calls it personal notes, credits Brendan Gregg for the original demos, and says it was made with Video Puppet, a tool that produces narrated slide videos, so expect a synthetic voice. Its value is that it walks the same Netflix checklist with output on screen. I chose it over Gregg’s own 72-second companion video, which is in deeper, because that one is too short to teach from. I judged the embed from its description and title only. English was judged from its English caption track. A human-presented alternative, The Lazy SysAdmin’s five-command version from September 2026, is also in deeper.
Where this fits
When the checklist points at storage, the next step is reading disk statistics properly: disk and I/O bottlenecks.
Check yourself
`vmstat 1` shows `r` around 2 on a 16-CPU machine, `wa` at 45% and `b` at 9. Where do you look next?
Storage. The CPUs are mostly waiting on I/O and nine tasks are blocked, so run `iostat -xz 1` to find the device and `pidstat -d 1` to find who is doing the I/O.
`mpstat -P ALL 1` shows overall CPU at 12% on an 8-CPU box, but CPU 3 at 100%. What does that suggest?
A single-threaded bottleneck: one thread, or one interrupt queue, is saturating one CPU while the average looks healthy. `pidstat -t` can find the thread.
Why is the first line of `vmstat 1` misleading during an incident?
The man page says the first report gives averages since the last reboot, so it mixes days of normal behaviour into the number. Read the lines after it.
`sar -n DEV 1` shows normal traffic but `sar -n ETCP 1` shows retransmissions climbing. What does that point to?
Network trouble or an overloaded peer: segments are being lost and resent. Packet capture or the remote host's metrics are the next step.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.