Skip to main content

Incident Simulation Labs

Advanced ๐Ÿ“‹ Quick reference: Incident Response Mastery โ†’
Learn this in 15 minutes15 min
  1. Read How To Use This Pack, then time-box yourself
  2. Read only the Alert of Incident 1 and decide what you'd check first
  3. Compare with "What You Should Check" and "What You're Expected To Discover"
  4. Repeat for Incidents 2โ€“4 before trying the hands-on labs

How To Use This Packโ€‹

For each incident:

  1. Read only the Alert.
  2. Start a 30-minute timer.
  3. Investigate.
  4. Identify:
    • Symptom
    • Root cause
    • Immediate mitigation
    • Long-term fix
  5. Write a 5-minute postmortem.

Table of Contentsโ€‹

  1. API Latency Spiking
  2. Server Down โ€” But Ping Works
  3. Disk 100% โ€” But df Shows Free Space
  4. High Load But Low CPU
  5. Out Of Memory Kill
  6. Connections Timing Out Randomly
  7. Container Is Slow But Host Is Fine
  8. DNS Is Broken
  9. Too Many Open Files
  10. System Won't Boot Properly
  11. Bonus: The Full Chaos Day
  12. Additional Hands-On Labs

๐Ÿงญ Mental modelHow each simulation drill is workedEvery drill starts from a single alert on a 30-minute timer, fans out into four things to identify โ€” symptom, root cause, immediate mitigation, and long-term fix โ€” then converges into a short written postmortem.Alert30-minute timer startsSymptomwhat's observedRoot Causewhy it happenedImmediate Fixstop the bleedingLong-term Fixprevents recurrence5-Minute Postmortemwrite it down while it's fresh

Every drill in this pack follows the same shape: one alert starts a 30-minute clock, you fan out to pin down the symptom, root cause, immediate mitigation, and long-term fix, then converge everything into a short postmortem before moving to the next drill.

๐Ÿงจ INCIDENT 1 โ€” "API Latency Spiking"โ€‹

๐Ÿšจ Alertโ€‹

Latency p95 jumped from 40ms โ†’ 3s. CPU at 95%. Users reporting slowness.

๐Ÿ–ฅ Setup (Cause It)โ€‹

yes > /dev/null &
yes > /dev/null &
yes > /dev/null &

๐Ÿ”Ž What You Should Checkโ€‹

  • top
  • uptime
  • mpstat
  • pidstat
  • ps aux --sort=-%cpu

๐Ÿง  What You're Expected To Discoverโ€‹

  • CPU saturation
  • Run queue backlog
  • Possibly a noisy neighbor process

๐ŸŽฏ Skills Testedโ€‹

  • Load average understanding
  • User vs system CPU
  • Process prioritization (nice, renice)
  • Killing safely

๐Ÿงจ INCIDENT 2 โ€” "Server Down โ€” But Ping Works"โ€‹

๐Ÿšจ Alertโ€‹

App is unreachable. Ping works. Port 443 times out.

๐Ÿ–ฅ Setupโ€‹

systemctl stop nginx

Or simulate a firewall block:

iptables -A INPUT -p tcp --dport 443 -j DROP

๐Ÿ”Ž Investigate Withโ€‹

  • ss -tulpn
  • systemctl status
  • journalctl -xe
  • iptables -L
  • tcpdump -i any port 443

๐Ÿง  Expected Discoveryโ€‹

Service not listening, OR firewall silently dropping packets.

๐ŸŽฏ Skills Testedโ€‹

  • Port binding
  • Packet visibility
  • Service dependency awareness

๐Ÿงจ INCIDENT 3 โ€” "Disk 100% โ€” But df Shows Free Space"โ€‹

๐Ÿšจ Alertโ€‹

App cannot write logs. Error: "No space left on device". df -h shows 40% free.

๐Ÿ–ฅ Setupโ€‹

Open and delete a file while still writing:

tail -f /var/log/syslog > bigfile.log &
rm bigfile.log

๐Ÿ”Ž Investigateโ€‹

  • df -h
  • lsof | grep deleted
  • /proc/<pid>/fd

๐Ÿง  Expected Discoveryโ€‹

A deleted file is still held open by a process.

๐ŸŽฏ Skills Testedโ€‹

  • File descriptor leaks
  • Linux inode behavior
  • Disk debugging beyond df

๐Ÿงจ INCIDENT 4 โ€” "High Load But Low CPU"โ€‹

๐Ÿšจ Alertโ€‹

Load average = 15. CPU usage only 20%.

๐Ÿ–ฅ Setupโ€‹

Simulate disk wait:

dd if=/dev/zero of=bigfile bs=1M count=5000 oflag=dsync

๐Ÿ”Ž Investigateโ€‹

  • vmstat 1
  • iostat -x
  • top (check iowait)
  • pidstat -d

๐Ÿง  Expected Discoveryโ€‹

High I/O wait. Processes stuck in uninterruptible sleep (D state).

๐ŸŽฏ Skills Testedโ€‹

  • Load average meaning
  • iowait analysis
  • Disk bottleneck detection

๐Ÿงจ INCIDENT 5 โ€” "Out Of Memory Kill"โ€‹

๐Ÿšจ Alertโ€‹

App randomly restarting. Kernel logs show crash.

๐Ÿ–ฅ Setupโ€‹

stress --vm 2 --vm-bytes 2G

๐Ÿ”Ž Investigateโ€‹

  • dmesg
  • journalctl
  • /proc/meminfo
  • free -m

๐Ÿง  Expected Discoveryโ€‹

OOM Killer terminated the process.

๐ŸŽฏ Skills Testedโ€‹

  • Memory pressure detection
  • OOM log reading
  • Swap analysis
  • Overcommit behavior

๐Ÿงจ INCIDENT 6 โ€” "Connections Timing Out Randomly"โ€‹

๐Ÿšจ Alertโ€‹

Intermittent 502 errors. Connections hang 30 seconds.

๐Ÿ–ฅ Setupโ€‹

Simulate SYN backlog exhaustion:

hping3 -S -p 80 --flood <server_ip>

Or open many connections:

for i in {1..10000}; do nc <server_ip> 80 & done

๐Ÿ”Ž Investigateโ€‹

  • ss -s
  • netstat -an | grep SYN
  • tcpdump
  • /proc/sys/net/ipv4/tcp_max_syn_backlog

๐Ÿง  Expected Discoveryโ€‹

Connection queue saturation.

๐ŸŽฏ Skills Testedโ€‹

  • TCP handshake knowledge
  • Backlog tuning
  • SYN flood basics

๐Ÿงจ INCIDENT 7 โ€” "Container Is Slow But Host Is Fine"โ€‹

๐Ÿšจ Alertโ€‹

Container CPU 100%. Host CPU 40%.

๐Ÿ–ฅ Setupโ€‹

Limit container CPU:

docker run --cpus=0.5 nginx

๐Ÿ”Ž Investigateโ€‹

  • docker stats
  • docker inspect
  • cat /sys/fs/cgroup/*

๐Ÿง  Expected Discoveryโ€‹

cgroup CPU throttling.

๐ŸŽฏ Skills Testedโ€‹

  • cgroups
  • Resource isolation
  • Container vs host debugging

๐Ÿงจ INCIDENT 8 โ€” "DNS Is Broken"โ€‹

๐Ÿšจ Alertโ€‹

Service cannot reach the database by hostname. IP works fine.

๐Ÿ–ฅ Setupโ€‹

Break /etc/resolv.conf.

๐Ÿ”Ž Investigateโ€‹

  • dig
  • nslookup
  • cat /etc/resolv.conf
  • strace curl example.com

๐Ÿง  Expected Discoveryโ€‹

DNS resolution misconfiguration.


๐Ÿงจ INCIDENT 9 โ€” "Too Many Open Files"โ€‹

๐Ÿšจ Alertโ€‹

Error: "Too many open files"

๐Ÿ–ฅ Setupโ€‹

ulimit -n 50

Then run a connection-heavy app.

๐Ÿ”Ž Investigateโ€‹

  • ulimit -a
  • /proc/<pid>/limits
  • lsof
  • /etc/security/limits.conf

๐Ÿง  Expected Discoveryโ€‹

File descriptor exhaustion.


๐Ÿงจ INCIDENT 10 โ€” "System Won't Boot Properly"โ€‹

๐Ÿšจ Alertโ€‹

Instance stuck in emergency mode.

Causes To Simulateโ€‹

  • Corrupt /etc/fstab
  • Fill root disk
  • Remove a critical system file (VM only)

๐Ÿ”Ž Investigateโ€‹

  • Single-user mode
  • journalctl -xb
  • mount -a

๐ŸŽฏ Skills Testedโ€‹

  • Boot process knowledge
  • Recovery under pressure

๐Ÿ”ฅ Bonus: The "Full Chaos Day"โ€‹

Simultaneously:

  • Fill disk
  • Create CPU stress
  • Break DNS
  • Limit file descriptors

Then debug under time pressure.


๐Ÿงช Additional Hands-On Labsโ€‹

These labs mirror the incidents above but are structured as discrete practice exercises โ€” run each on a disposable VM (EC2, local VM, or WSL) in order to build intuition.

Lab 1 โ€” Find the CPU Killerโ€‹

Goal: Identify which process is consuming CPU and why.

yes > /dev/null &
yes > /dev/null &
yes > /dev/null &

Tasks: find top CPU process โ†’ identify PID/parent โ†’ reduce impact without killing immediately โ†’ stop it safely.

top
ps aux --sort=-%cpu | head
pstree -p
renice 10 -p <PID>
kill -15 <PID>

๐Ÿ’ก SRE Insight: High CPU โ‰  crash. First contain impact, then fix.

Lab 2 โ€” Memory Leak Simulationโ€‹

Goal: Detect abnormal memory consumption.

python3 -c "a=[]; [a.append('A'*10**6) for _ in range(5000)]"
top
ps aux --sort=-%mem | head
cat /proc/<PID>/status | grep Vm

๐Ÿ’ก SRE Insight: Always confirm memory usage from /proc, not just top.

Lab 3 โ€” File Descriptor Leakโ€‹

Goal: Detect "Too many open files" condition.

while true; do cat /dev/null > tempfile_$RANDOM; done
pgrep -fl cat
ls /proc/<PID>/fd | wc -l
cat /proc/<PID>/limits

๐Ÿ’ก SRE Insight: FD exhaustion is a very common production outage cause.

Lab 4 โ€” Zombie Process Investigationโ€‹

Goal: Identify zombie processes and their parent.

bash -c 'sleep 1 & exit'
ps aux | grep Z
pstree -p

๐Ÿ’ก SRE Insight: You fix zombies by fixing the parent, not the zombie.

Lab 5 โ€” Unkillable Process (I/O Wait)โ€‹

Goal: Understand why some processes won't die.

dd if=/dev/zero of=bigfile bs=1M count=5000
ps -o pid,state,cmd -p <PID>
kill -15 <PID>
kill -9 <PID>

๐Ÿ’ก SRE Insight: State D โ†’ waiting on kernel I/O โ†’ not killable.

Lab 6 โ€” Full Production Debug Simulationโ€‹

Scenario: "Service is slow, CPU low, users complaining."

pgrep -fl service
top -p <PID>
cat /proc/<PID>/status
ls /proc/<PID>/fd | wc -l
cat /proc/<PID>/limits
pstree -p <PID>

What the interviewer wants: you systematically rule out CPU, memory, FD exhaustion, process tree issues, and resource limits โ€” in that order.


๐Ÿง  What Senior SREs Do Differentlyโ€‹

They:

  • Check saturation first
  • Look at queues
  • Validate assumptions with data
  • Avoid random restarts
  • Think in bottlenecks

๐Ÿ If You Can Confidently Solve All 10โ€‹

You are operating at:

  • Strong mid-level SRE
  • Possibly senior, depending on speed and clarity

Summaryโ€‹

  • ๐Ÿ’ก Always read only the alert first โ€” resist the urge to peek at the "expected discovery" before investigating.
  • ๐Ÿ”ฅ Time-box each incident to 30 minutes to simulate real production pressure.
  • โš ๏ธ The same symptom (e.g., "slow, CPU low") can map to I/O wait, FD exhaustion, or dependency latency โ€” verify with evidence, don't assume.
  • โœ… Always write the 5-minute postmortem โ€” it's where the actual learning compounds.

See Alsoโ€‹