API Latency Spike Playbook
Response times climbing, SLOs breaching, users experiencing timeouts. The kind of degradation that creeps up slowly, then avalanches into customer impact. Here's how to diagnose fast and mitigate decisively.
IMMEDIATE RECOGNITION SIGNALS
- • P95/P99 latency climbing above SLO thresholds
- • Timeout alerts firing from client applications
- • User complaints about slow page loads
- • Queue depths backing up
- • Error rate climbing as timeouts increase
First 5 Minutes: Rapid Assessment
Acknowledge and size the blast radius
Check which services/endpoints affected. Is it everything or specific paths? What percentage of traffic?
Verify monitoring and baselines
Compare current latency to last hour, last day. Confirm alerts aren't false positives from monitoring lag.
Check recent changes
Any deploys in last 2 hours? Config changes? Database migrations? Traffic pattern changes?
Examine resource utilization
CPU, memory, disk I/O on app servers and databases. Connection pool exhaustion? Thread pool saturation?
Declare incident if SLO breach confirmed
If P95 > 2x normal or P99 > 3x normal for 5+ minutes, declare SEV-2. Get help.
Common Contributing Factors
Application Layer
- • Inefficient database queries (N+1, missing indexes)
- • Memory leaks causing GC pressure
- • Thread pool exhaustion
- • Synchronous calls to slow dependencies
- • Cache misses from expired/invalidated data
- • Connection pool leaks
Infrastructure Layer
- • Database load/locking contention
- • Network partition or degraded links
- • Disk I/O saturation
- • Auto-scaling lag behind traffic spike
- • Load balancer health check failures
- • Noisy neighbor effects in shared infrastructure
Diagnostic Decision Tree
1. Is latency correlated with error rate increase?
YES → Likely capacity/resource exhaustion. Check CPU, memory, connection pools.
NO → Slow dependency or query performance issue. Check database, external API calls.
2. Did latency spike suddenly or gradually increase?
SUDDEN → Recent deployment, config change, or external dependency failure.
GRADUAL → Resource leak, growing dataset, or traffic pattern shift.
3. Is the issue affecting all endpoints equally?
ALL ENDPOINTS → Infrastructure bottleneck (database, network, shared resource).
SPECIFIC ENDPOINTS → Code inefficiency or endpoint-specific dependency issue.
Mitigation Strategies (In Priority Order)
Immediate Relief (0-15 minutes)
- Scale up app instances: If auto-scaling exists, manually trigger it. Add capacity fast.
- Increase connection limits: Bump database connection pools, HTTP client timeouts temporarily.
- Enable circuit breakers: If available, fail fast on slow dependencies to prevent cascade.
- Restart problematic services: If memory leak suspected, restart can buy time.
Targeted Fixes (15-60 minutes)
- Database optimization: Kill long-running queries, add emergency indexes, enable query cache.
- Cache warming: Pre-populate caches for critical data if cache miss is the culprit.
- Traffic shaping: Rate limit non-critical endpoints, prioritize core user flows.
- Rollback recent changes: If deployment correlation found, rollback immediately.
Sustainable Solutions (1+ hours)
- Query optimization: Analyze slow query logs, add proper indexes, rewrite N+1 queries.
- Resource right-sizing: Increase database CPU/memory, scale connection pools permanently.
- Caching strategy: Implement application-level caching for expensive operations.
- Async processing: Move heavy computation to background jobs.
Communication Templates
Executive Status Update
INCIDENT UPDATE - SEV-2 API Latency Spike Time: [HH:MM UTC] Status: Mitigating IMPACT: - API response times 3-5x normal (P95: 2.1s vs 400ms baseline) - ~15% of requests experiencing timeouts - Affecting user dashboard loads and checkout flow CURRENT STATE: - Root cause identified: Database query performance degradation - Mitigation in progress: Scaling app instances +50%, query optimization underway - No data loss or security impact NEXT UPDATE: In 20 minutes IC: [Your name]
Customer Status Page Update
We are currently experiencing slower than normal response times across our platform. What's happening: Users may experience delayed page loads and occasional timeouts when accessing their dashboard and during checkout. What we're doing: Our engineering team has identified the cause and is actively implementing fixes. We are scaling our infrastructure and optimizing performance. We will provide another update in 20 minutes.
Post-Incident Questions
What was the first signal that alerted us to the latency issue?
How long between symptom onset and incident declaration?
Which mitigation action provided the most immediate relief?
Could we have detected this earlier with better monitoring?
What prevented auto-scaling from handling the load effectively?
Are there code-level optimizations that would prevent recurrence?
How can we improve our latency SLI/SLO definitions?
What tooling would have accelerated our diagnosis?