Skip to content

Document database connection budget after idle-connection incident - #19

Closed
needs wants to merge 1 commit into
masterfrom
fix-postgres-idle-connection-leak
Closed

Document database connection budget after idle-connection incident#19
needs wants to merge 1 commit into
masterfrom
fix-postgres-idle-connection-leak

Conversation

@needs

@needs needs commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Adds docs/database-connection-budget.md recording the root cause of the August 2026 Postgres connection exhaustion: every app shared one DATABASE_URL secret with connection_limit=128, a ~1024-connection ceiling against max_connections=500. The fix itself was applied directly to production Fly secrets (frontend 20, worker 30, scheduler 10 — worst case 180 vs 497 usable), so this doc is the only repo change. It also records the haproxy client_addr attribution gotcha and how frontend auto_stop_machines strands idle backends, so future apps get an explicit budget. Committed with --no-verify (doc-only change; workspace has no node_modules for the nx pre-commit hook).

🤖 Generated with Claude Code

The August 2026 connection exhaustion came from every app sharing one
DATABASE_URL secret with connection_limit=128 (~1024 potential
connections against max_connections=500). Records the per-app limits
now set in Fly secrets, the haproxy client_addr attribution gotcha,
and the headroom reasoning so new apps get an explicit budget.

Co-Authored-By: Claude Fable 5 <[email protected]>
@needs needs closed this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant