Executive Incident Summary
The production outage affected 75% of our microservices, resulting in a blast radius of 3000+ users, with a severity level of SEV-1. The Mean Time to Detect (MTTD) was 15 minutes, and the Mean Time to Recovery (MTTR) was 2 hours. The outage was caused by a cascading OOMKilled storm triggered by Kubernetes CPU CFS quotas, which led to heap exhaustion of our JVM-based microservices.
The Failure Cascade & Timeline
The issue manifested in production at 10:00 AM, starting with a single microservice experiencing high CPU usage. The initial alert triggered was a CPU usage threshold breach, which was misdiagnosed as a simple scaling issue. As the day progressed, more microservices began to exhibit similar behavior, and the alerts escalated to a full-blown outage. The timeline of events is as follows:
- 10:00 AM: Initial CPU usage threshold breach alert for a single microservice
- 10:30 AM: Multiple microservices start exhibiting high CPU usage
- 11:00 AM: First OOMKilled event occurs, triggering a pod restart
- 11:30 AM: Cascading OOMKilled storms begin, affecting 75% of microservices
- 12:00 PM: Full-blown outage declared, with all affected microservices restarted
Root Cause Analysis (Deep Technical Dive)
The root cause of the outage was a misconfigured CPU quota in our Kubernetes cluster. The CPU CFS (Completely Fair Scheduler) quota was set too low, causing the JVM-based microservices to experience CPU throttling. When the JVM is CPU-throttled, it cannot perform garbage collection efficiently, leading to heap exhaustion. The OOMKilled storm was triggered when the JVM’s heap was exhausted, causing the Linux kernel to kill the process. This, in turn, triggered a pod restart, which exacerbated the issue due to the cascading nature of the failure.
Architecture & Failure Sequence
sequenceDiagram
autonumber
participant JVM as "JVM-based Microservice"
participant K8s as "Kubernetes"
participant Linux as "Linux Kernel"
note over JVM,Linux: CPU CFS quota set too low
JVM->>K8s: Request CPU resources
K8s->>Linux: Throttle CPU usage due to CFS quota
Linux->>JVM: CPU throttling, reduced garbage collection efficiency
JVM->>JVM: Heap exhaustion due to reduced garbage collection
Linux->>JVM: OOMKilled event, process termination
K8s->>K8s: Pod restart due to process termination
note over JVM,Linux: Cascading OOMKilled storm
The Fix & Remediation
To permanently eliminate the vulnerability, we increased the CPU CFS quota to a more reasonable value, ensuring that the JVM-based microservices have sufficient CPU resources to perform garbage collection efficiently. The exact configuration diff is as follows:
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
containers:
- name: example-container
resources:
requests:
cpu: 200m
limits:
cpu: 400m
We also implemented preventative SLO/alert recommendations, including:
- CPU usage threshold breaches
- OOMKilled event detection
- Pod restart monitoring
- JVM heap usage monitoring These recommendations will help detect similar issues before they escalate into full-blown outages. Additionally, we will be implementing regular audits of our Kubernetes configuration to ensure that CPU CFS quotas are set correctly.