Linux Production Troubleshooting
The host-level skills every other stack sits on: disk, filesystem, memory, processes, and the commands that expose what a box is actually doing.
- Who it’s for
- Anyone operating Linux servers who wants a repeatable triage method instead of guesswork.
- Prerequisites
- Basic shell familiarity.
Skills you’ll build
- ✓Read disk/inode/memory pressure quickly
- ✓Trace a process’s resource use
- ✓Use the right diagnostic command for the symptom
-
Module 1
Command-line fluency for diagnosis
Know the safe, high-signal commands (and the destructive ones to flag) before you need them under pressure.
Diagnostic commands run in order — each one narrows the fault
- Check system load and run queue
uptime && vmstat 1 5Load above the CPU count with high `r` in vmstat means CPU saturation; high `b` and `wa` means the box is blocked on I/O, not compute.
- List failed systemd units
systemctl --failed --no-pagerAny unit here is a service that tried to start and gave up. Empty output is the healthy case.
- Read the most recent errors
journalctl -p err -b --no-pager | tail -50Priority-error entries since boot. Look for the FIRST error in a burst — later ones are usually consequences.
- Test DNS resolution
resolvectl query example.com || dig +short example.comNo answer, or a long delay before one, points at /etc/resolv.conf, the systemd-resolved stub, or an upstream resolver.
- Check routes and default gateway
ip route show && ip -brief addressA missing default route explains "Network is unreachable" instantly. Confirm the interface is UP and holds the address you expect.
- List listening ports
ss -tulpnConfirms whether the service is actually bound, and on which address. Bound to 127.0.0.1 when you expected 0.0.0.0 is a very common cause of "connection refused".
-
-
Module 2
Disk and filesystem errors
Diagnose "no space left on device" (bytes vs inodes), read-only remounts, and mount failures.
Diagnostic commands run in order — each one narrows the fault
- Check free space and inodes
df -h && df -iA filesystem can be 40% full by bytes and 100% full by inodes — both produce "No space left on device". Always check both.
- Find what is consuming the space
du -xh --max-depth=1 / 2>/dev/null | sort -rh | head -20`-x` keeps it on one filesystem so you do not walk network mounts. Work down the tree from the largest entry.
- Find deleted-but-open files
lsof +L1 2>/dev/null | head -20Space that df reports as used but du cannot find is usually a deleted file still held open by a process. Restarting that process reclaims it.
- Check for read-only remounts
mount | grep -E "\\bro\\b" && dmesg -T | grep -iE "remount|ext4|xfs|i/o error" | tail -20A filesystem remounted read-only means the kernel hit an I/O error and protected itself. Treat it as a hardware/storage problem until proven otherwise.
Exercise
A service is failing writes but `df -h` shows free space. Determine whether you’re out of inodes, hitting a read-only filesystem, or blocked by permissions.
Open in Workspace → -
-
Module 3
Processes, memory, and resource pressure
Find the process behind CPU/memory pressure and understand OOM behavior.
Diagnostic commands run in order — each one narrows the fault
- Top memory and CPU consumers
ps aux --sort=-%mem | head -15Identifies the process actually holding the memory, rather than the one that happened to fail first.
- Check for OOM kills
journalctl -k --no-pager | grep -i "killed process" | tail -20Each line names the victim and its RSS. A repeatedly-killed process is under-provisioned or leaking.
- Inspect memory pressure and swap
free -h && cat /proc/pressure/memory 2>/dev/nullPSI `some avg10` above ~10 means real memory stall, even when free memory looks acceptable.
- Check open file descriptor limits
ulimit -n && cat /proc/sys/fs/file-nr"Too many open files" is almost always the per-process soft limit, not the system-wide one. Compare both.
-
-
Module 4
Run a host incident in the workspace
Triage a slow/unhealthy host end-to-end and export the summary.
Exercise
A host is slow and one service keeps restarting. Triage disk, memory, and the failing unit; record findings and root cause.
Open in Workspace →
Mission complete 🎉
You’ve worked every module of Linux Production Troubleshooting.
Next: Docker Production Readiness →Related