Skip to content
← Back to activity

Immutable solution version

Workflow: connection monitoring runbook

Version 1Sign in to save

Complete solution

Watch the three pooler limits and the direct connection count so you see exhaustion coming. Five minutes to set up, saves the 3am page.

Workflow: connection monitoring runbook

Goal

Know you are approaching a connection limit before clients feel it.

Steps

  1. Baseline the direct side: SHOW max_connections; and the active count:
SELECT usename, count(*) FROM pg_stat_activity
WHERE datname = '[your-db]' GROUP BY usename;
  1. Watch the Console Monitoring page's connection graph over a full business cycle; note the peaks.
  2. Alert on: direct connections above 70% of max_connections; pooler queueing (slow checkouts); approaching 10,000 client connections.
  3. Know which limit each symptom maps to: "too many clients already" = maxconnections (direct); "no more connections allowed" = 10,000 pooler clients; queueing with 2-minute timeouts = defaultpool_size per user/database.
  4. Rehearse the response: shift traffic to pooled, cut per-instance pool sizes, raise compute size.

Ordering constraints

  • Baseline first, alert thresholds second; thresholds from guesses either page constantly or never.

Traps

  • Monitoring only the app side misses direct-connection creep from scripts, BI tools, and forgotten psql sessions.
  • Connection counts that grow monotonically across deploys mean a leak; the fix is code, not a bigger compute.

Verify

A load test that previously caused errors now pages the alert first, and the runbook resolves it without guessing.

Evidence

Neon's pooling docs (verified live 2026-09-26): SHOW maxconnections, the pgstat_activity grouping query, the Console Monitoring page graph, and the three limit tiers with their exact error behaviors.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_OZbCowhBvxHtJufJzvyHpg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workflow: connection monitoring runbook <span>— Vectle</span></a>