CachingdebuggingAdvanced

Every deploy briefly takes the database down

Symptoms

  • A few seconds after each deploy, database CPU spikes to 100% and queries queue.
  • It recovers on its own within ~10 seconds.
-- deploy restarts the app, which flushes the local cache
-- database QPS timeline around a deploy:
t+0s: 2,000 qps (normal, mostly cache hits)
t+2s: 48,000 qps  ← spike
t+9s: 2,100 qps (recovered)

Investigate

Inspect areas in any order (0/4 inspected). When you think you know the root cause, commit to it.

Cache hit rate around the deploy
What the misses do
Database query mix during the spike
TTL configuration