0 / 15 lessons — 0%
Lesson 13 / 15 🔍
Performance monitoring & troubleshooting
"The server is slow" is not a diagnosis. The job is narrowing it down to CPU, memory, disk, or network — fast — and Linux hands you a tool for each.
| Suspect | Check with | Red flag |
|---|---|---|
| CPU | top / htop, load average | Load average consistently above the number of CPU cores |
| Memory | free -h | Available memory near zero, swap usage climbing |
| Disk I/O | iostat -x 1 | %util near 100%, high await times |
| Disk space | df -h | Any filesystem near 100% used — many services fail ungracefully at 100% |
| Network | ss -s, iftop | Unexpectedly high connection counts or bandwidth |
uptime # load average — the fastest first check there is free -h # memory + swap, human-readable vmstat 1 5 # 5 samples, 1 second apart — CPU, memory, IO at a glance iostat -x 1 # per-disk I/O stats (may need sysstat installed) df -h # is anything actually full?
Load average (from uptime) is three numbers — 1, 5, and 15-minute averages of how many processes are waiting for CPU time. A load of 8.0 on a 4-core machine means real, sustained CPU pressure; the same number on a 16-core box is barely a shrug.
A quick mental checklist when something's "just slow":
uptime for load, free -h for memory, df -h for disk space, ss -tulpn for anything unexpected listening. Four commands, under a minute, and you usually know which of the four suspects it actually is.Try it yourselfRun
uptime, then nproc (number of CPU cores) right after it. Divide the 1-minute load average by the core count — above 1.0 means the CPU is genuinely oversubscribed right now.