Linux Curriculum
On this page
- Troubleshooting Methodology
- 1. Architectural Concept & Deep Dive
- The USE Method (Resource-Oriented)
- The RED Method (Request-Oriented)
- 3. The 60-Second Linux Triage Checklist
- 4. Hands-on Terminal Lab: Interpreting Triage Outputs
- Step 1: Interpreting uptime Load Average
- Step 2: Dissecting vmstat 1 5
- 5. Top-Down vs Bottom-Up Investigation
- 6. The Scientific Method of Incident Resolution
- 7. Key Takeaways
Troubleshooting Methodology
1. Architectural Concept & Deep Dive
When a production incident strikes—whether it is latency degradation, cascading service timeouts, or total node unresponsiveness—haphazardly executing arbitrary commands causes diagnostic noise, wastes critical MTTR (Mean Time to Resolution), and can exacerbate the failure.
Elite Systems and SRE engineers employ formal performance and troubleshooting methodologies to systematically narrow down the root cause from the application layer down to the silicon:
2. Core Methodologies: USE vs RED
The USE Method (Resource-Oriented)
Formulated by Brendan Gregg, the USE Method targets every physical and virtual hardware resource (CPUs, memory buses, disks, network interfaces, cgroups):
- U - Utilization: The average time that the resource was busy servicing work (e.g., 90% CPU busy, 100% disk utilization).
- S - Saturation: The degree to which extra work is queued waiting for the resource (e.g., CPU run-queue length, disk queue depth, memory swapping).
- E - Errors: The count of error events (e.g., dropped packets, PCIe bus errors, disk I/O retries).
The RED Method (Request-Oriented)
Formulated by Tom Wilkie, the RED Method targets application endpoints and microservices:
- R - Rate: The number of requests serviced per second (throughput).
- E - Errors: The number of failed requests per second (HTTP 5xx, TCP resets).
- D - Duration: The amount of time requests take to complete (latency percentiles: p50, p95, p99).
3. The 60-Second Linux Triage Checklist
In the first minute of connecting to an impacted Linux server, execute this standardized 10-command sequence:
4. Hands-on Terminal Lab: Interpreting Triage Outputs
Step 1: Interpreting uptime Load Average
- Analysis:
- Determine total CPU cores:
nproc(e.g. 4 cores). - Load average is 18.42 on a 4-core box! This indicates heavy saturation (14.42 processes are waiting in queue).
- In Linux, load average includes both runnable tasks (
R) AND uninterruptible disk sleep tasks (D). Load alone does not distinguish between CPU saturation and disk I/O deadlock!
- Determine total CPU cores:
Step 2: Dissecting vmstat 1 5
r(14): 14 runnable processes competing for CPU (matches load average).b(2): 2 processes blocked in uninterruptible sleep (D), waiting on disk/NFS.si/so(0/0): No swap-in or swap-out. Memory is not thrashing.us(85): 85% CPU consumed in userspace (application code).sy(12): 12% CPU spent in kernel space (syscall overhead).id(0): 0% idle; CPU is 100% saturated.wa(3): Low disk wait. Conclusion: pure CPU exhaustion in userspace.
5. Top-Down vs Bottom-Up Investigation
- Top-Down: Best when users report slow queries or timeouts. Start at application metrics (RED), profile syscalls (
strace), then inspect OS resource limits. - Bottom-Up: Best when alerting detects high node CPU, OOM kills, or disk saturation. Start at kernel metrics (USE), identify the offending PID via
top/pidstat, then inspect application thread dumps.
6. The Scientific Method of Incident Resolution
- Observe: Collect factual telemetry without preconceived bias (
uptime,dmesg,vmstat). - Hypothesize: Formulate a falsifiable theory (e.g., "Thread contention on mutex in service X is driving 100% CPU in kernel mode").
- Predict: If the hypothesis is true, what specific metric must follow? (e.g., "Context switch rate
csinvmstatmust be > 100,000/s"). - Test & Verify: Run
perf topor inspect/proc/<PID>/status. If verified, apply mitigation. If disproved, reject and formulate a new hypothesis. - Document: Record exact timeline, root cause, and remediation steps in a Blameless Post-Mortem.
7. Key Takeaways
- Never guess or reboot blindly; follow a structured diagnostic workflow.
- The USE Method (Utilization, Saturation, Errors) guides hardware and OS layer triage.
- The RED Method (Rate, Errors, Duration) guides microservice endpoint triage.
- Linux load average includes both runnable (
R) and uninterruptible sleep (D) tasks; usevmstatto identify whether CPU or I/O is the bottleneck. - Master the 60-second triage checklist to quickly isolate root causes during active production incidents.