Live demo · the Whyfire screens as on-call sees them · read-only← The guided demoJoin the waitlist
Whyfire AI write-up on · claude-opus-5-5
← Resolved incidents
criticalinc_20261026_5cd6b8ef · 2026-10-26 17:26 UTC

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)

Cause · from the AI investigation
worker-01's 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.
The statistics agree: worker-01, TCP connections, opened as the database ran out of them 4 → 40, at the alarm.
TCP connections, opened as the database ran out of them on worker-01: from 0 to 40 over the 70 minutes before the alarm and 1 after; usual level 4.alarm40070 min before1 min after

What changed, earliest first

ServerWhat changedBefore → afterStartedSize of jump
db-01CPU busy 2.1% → 100%
+98 points
chartCPU busy on db-01: from 0% to 100% over the 30 minutes before the alarm and 1 after; usual level 2.1%.
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/min
chartdatabase connection limit hit on 3 servers: from 0/min to 236/min over the 30 minutes before the alarm and 1 after; 3 servers.
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/min
chartlog lines per minute on 4 servers: from 0/min to 242/min over the 30 minutes before the alarm and 1 after; 4 servers.
at the alarm huge
db-01load per core 0 → 14.8
+14.8
chartload per core on db-01: from 0 to 14.8 over the 30 minutes before the alarm and 1 after; usual level 0.
at the alarm huge
db-01memory used 46.6% → 67.8%
+21 points
chartmemory used on db-01: from 45.8% to 67.8% over the 30 minutes before the alarm and 1 after; usual level 46.6%.
at the alarm big
shop.example.com raised no alertwebsite answering effect 1 → 0
chartwebsite answering on shop.example.com: from 0 to 1 over the 30 minutes before the alarm and 1 after; usual level 1.
at the alarm clear
worker-01 raised no alertTCP 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