Someone flushed Redis to fix stale data; seconds later the DB hit 100% CPU and the site threw 5xx for 15 minutes.

AdvancedTroubleshooting5xx errors
Answer

Likely causes → Cache stampede (thundering herd): every request missed the cache at once and went to the DB, which was sized for a 95% hit rate.

Diagnose → Cache hit ratio dropped to near zero exactly when DB QPS and CPU spiked.

Fix → Shed load: rate-limit at the edge, temporarily serve stale or static responses, and warm the hottest keys from a script. Scale read replicas if available.

Prevent → Never FLUSHALL in production; invalidate specific keys instead. Use request coalescing (single-flight) so one request refills each key, add TTL jitter, and plan DB capacity for a cold-cache scenario.

All Real-World Interview questions Roadmap: Interview readiness

More on 5xx errors