DatabaseConnectionsFull on 3 servers
Resolved 17:40 UTC after 15 min
This alert on these servers: 31st time in 30 days · usually over in 15 min · last 3 h ago
A database is refusing connections (seen on app-02)
order-stats job started at 17:24:26 and opened about 35 connections to db-01, taking every free Postgres slot, so db-01 refused app-01 and app-02.What changed, earliest first
| Server | What changed | Before → after | Started | Size of jump |
|---|---|---|---|---|
| db-01 | CPU busy | 2.1% → 100% +98 points chart | 4 min before the alarm | huge |
| 3 servers db-01, app-01, app-02 same minute | database connection limit hit “[6-1] 2026-10-26 17:24:27.032 UTC [2717063] shop@shop FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute” |
0/min → 47–236/minchart | at the alarm | huge |
| 4 servers db-01, web-01, app-01, app-02 same minute | log lines per minute “postgres: [6-1] 2026-10-26 17:24:27.032 UTC [2717063] shop@shop FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute” new kind of line, 198.3/min (none in the hour before) (on db-01) |
3–3.5/min → 50–242/minchart | at the alarm | huge |
| db-01 | load per core | 0 → 14.8 +14.8 chart | at the alarm | huge |
| db-01 | memory used | 46.6% → 67.8% +21 points chart | at the alarm | big |
| shop.example.com raised no alert | website answering effect | 1 → 0chart | at the alarm | clear |
| worker-01 raised no alert | TCP connections, opened as the database ran out of them cause | 4 → 40 +36 | at the alarm | huge |
Investigation
Evidence:
- worker-01 log at 17:24:26: "order-stats: rebuilding order statistics, 40 partitions". db-01's first slot-refusal FATAL followed one second later.
- At 17:25 established TCP connections jumped from 4 to 39 on both worker-01 and db-01. app-01 and app-02 stayed at 3.
- db-01 CPU rose from 2% to 37% at 17:21. That was a root-run
stress-ng --cpu-load 70, which explains CPU but not connections.
Action: On db-01, run the runbook's pg_stat_activity query and terminate the shop sessions from 172.31.11.55. Then cap order-stats connections or put a pooler in front. Separately, find out why stress-ng is running on db-01.
Statistics check: I agree: worker-01 matches the confirmed past order-stats pattern. The unconfirmed write-ups blaming psql sessions on db-01 itself don't fit this evidence.
Written by claude-opus-5-5 from the evidence above.
Alerts in this incident
- DatabaseConnectionsFull on app-02 17:25 UTC
- DatabaseConnectionsFull on app-01 17:25 UTC
- DatabaseConnectionsFull on db-01 17:25 UTC
Runbook
The database has no free connection slots, so new connections are refused. Find who holds them before raising the limit.
- PostgreSQL:
SELECT usename, application_name, client_addr, state, count(*) FROM pg_stat_activity GROUP BY 1,2,3,4 ORDER BY 5 DESC; - A report job, a leak or idle sessions usually hold most: end them (
pg_terminate_backend) and fix the client, or put a pooler in front.
Whyfire's starter runbook
Incidents like this before
- Earlier incidents like this are not part of this demo
Silenced before
- Never silenced in the last 6 months
Also started nearby
- WebErrorRateHigh on web-01 at the alarm
2 AI turns · about $0.072