Linux Debugging Reference
You should deeply understand: /proc, strace, tcpdump, vmstat, iostat, systemctl, journalctl, top, ss.
Senior engineers think in: resource bottlenecks, kernel states, queues, backpressure, timeouts, failure domains.
Intermediate ๐ Quick reference: Incident Response Mastery โ- Start with the Practical Debugging Playbook
- Pick the subsystem you're debugging: CPU, memory, disk, or network
- Use the matching tool list rather than guessing
- Bookmark this page as your reference during incidents
Table of Contentsโ
- Practical Debugging Playbook
- Process Management
- Systemd
- CPU & Load Debugging
- Memory Management
- Disk & I/O Debugging
- Networking
- Logs & Observability
- Performance Debugging (USE / RED)
- Bash & Shell Skills
- Security & Permissions
- Containers
- Crash & Deep Debugging
- Boot Process
When production breaks, senior engineers don't guess โ they run down this fixed order: is the process running, is the port listening, is CPU saturated, is memory exhausted, is disk full, and are connections stuck, before diving into any subsystem-specific tooling.
Practical Debugging Playbookโ
When prod breaks, ask, in order:
- Is the process running?
- Is the port listening?
- Is CPU saturated?
- Is memory exhausted?
- Is disk full?
- Are connections stuck?
- Are there kernel errors?
- Is DNS resolving?
- Is the service reachable from another host?
- What changed?
1. Process Managementโ
Covered in depth in Process Management & /proc: PID/PPID, zombie/orphan processes, daemons, ps/top/htop/atop/pstree, nice/renice, kill/killall/pgrep, and the /proc/<pid>/ filesystem (status, limits, fd).
2. Systemd (Most Modern Distros)โ
You MUST understand:
systemctl statussystemctl start/stop/restartjournalctl -xejournalctl -u <service>- Unit files
- Service dependencies
- Restart policies
- Targets
3. CPU & Load Debuggingโ
๐น Load Averageโ
What it actually means: runnable + uninterruptible processes.
๐น Toolsโ
uptime, top, mpstat, vmstat, sar, pidstat
๐น CPU Conceptsโ
- User vs system CPU
- iowait
- Context switching
- CPU stealing (in VMs)
- CPU throttling
4. Memory Managementโ
๐น Conceptsโ
Virtual memory, paging, swapping, page cache, buffers, OOM killer
๐น Toolsโ
free -m, vmstat, top, htop, /proc/meminfo, smem, pmap
๐น Debugging Memory Issuesโ
- Detect memory leaks
- OOM logs (
dmesg) - Overcommit behavior
5. Disk & I/O Debuggingโ
๐น Conceptsโ
IOPS, throughput, latency, queue depth, block devices
๐น Toolsโ
iostat, iotop, vmstat, dstat, blktrace, lsblk
๐น Detectโ
- Disk saturation
- High iowait
- Filesystem corruption
Full storage & filesystem deep dive: Filesystem & Storage Playbook
6. Networking (Extremely Important for SRE)โ
๐น Basicsโ
TCP/IP model, 3-way handshake, DNS resolution, subnetting, routing tables
๐น Toolsโ
ip a, ip route, ss -tulpn, netstat, tcpdump, ping, traceroute, dig, nslookup, curl, nc
๐น Debug Skillsโ
- Port binding conflicts
- SYN backlog issues
- Connection resets
- Packet drops
- MTU issues
7. Logs & Observabilityโ
๐น Log Locationsโ
/var/log/syslog/var/log/messages/var/log/auth.log- Application logs
๐น Commandsโ
tail -f, less, grep, awk, sed, journalctl
๐น dmesgโ
Kernel logs: OOM killer, disk failures, driver errors.
8. Performance Debugging (The SRE Superpower)โ
The USE Methodโ
- Utilization
- Saturation
- Errors
The RED Methodโ
- Rate
- Errors
- Duration
๐น Advanced Toolsโ
strace, lsof, perf, sar, bpftrace, eBPF basics
9. Bash & Shell Skillsโ
๐น Must Knowโ
Pipes, redirection, subshells, environment variables, command substitution, exit codes, set -euo pipefail
๐น Scripting Basicsโ
Loops, conditionals, functions, debugging scripts (set -x)
10. Security & Permissionsโ
๐น SSHโ
Key-based auth, sshd_config, port forwarding
๐น Firewallsโ
iptables, nftables, ufw, firewalld
๐น SELinux / AppArmorโ
Modes, troubleshooting denials
Permissions model (rwx, SUID/SGID, ACLs) is covered in Filesystem & Storage Playbook.
11. Containers (Mandatory for Modern SRE)โ
- Namespaces
- cgroups
- PID namespace
- Network namespace
- OverlayFS
docker ps,docker logs,docker inspect,docker exec- Container resource limits
12. Crash & Deep Debuggingโ
- Core dumps
ulimit -cgdb- Kernel panic basics
kdump
13. Boot Processโ
- BIOS vs UEFI
- GRUB
- Init systems
- Single-user mode
- Emergency mode
Summaryโ
- ๐ก The 10-question Practical Debugging Playbook is the fastest triage sequence โ run it top to bottom before diving deep anywhere.
- ๐ฅ USE (resource-first) and RED (service-first) are complementary, not competing โ USE finds what's saturated, RED finds what users feel.
- โ ๏ธ Containers add a second layer of saturation (cgroup limits) that's invisible from host-level tools โ always check
docker stats/ cgroup files separately. - โ
/proc,strace,tcpdump,vmstat,iostat,systemctl,journalctl,top,ssโ if you're fluent in these nine, you can debug almost anything.