D

Runbook: database degraded

Symptoms#

  • Latency rises on database-backed routes while static paths stay fast.
  • Connection errors or pool-exhaustion messages in the application logs.
  • Replication lag growing rather than recovering.
  • CPU, memory or disk on the instance near its ceiling.

Checks#

1
Look at active queries first

What is running right now, and for how long. One long transaction holding a lock explains more slowdowns than any other single cause.

2
Check connections against the limit

Pool exhaustion looks like an application bug from the application's side. Compare current connections with the configured maximum before you go looking for one.

3
Check disk and memory

A full disk fails writes in ways that read as unrelated errors. Cache hit rate falling off a cliff means the working set no longer fits.

4
Correlate with the last deploy

A new query without an index, an N+1 introduced in a refactor, or a migration still running are the usual recent causes.

5
Check replication lag

If reads are served from a replica, a lagging replica returns stale data silently — which is worse than an error, because nothing alerts.

Actions#

  • Kill the blocking query, not every query. Note what it was before you kill it; that note is the fix.
  • Roll back a recent change if the timing implicates one — see Rollback.
  • Shed load deliberately: disable a heavy background job, reduce a batch size, rate-limit an expensive endpoint.
  • Add headroom if capacity genuinely is the cause, and size it properly afterwards rather than during.
Do not restart it to see if that helps

A restart discards the evidence, takes the cache with it, and on a busy system produces a thundering herd on the way back up. Restarting is a decision with a reason, not a first move.

Fill this in: the real commands for your database, and the numbers that mean trouble for your instance size.

Next steps#

Updated

Was this page helpful?