Menu

Why max_connections=500 Killed Our DB: Production Sizing & Config Guide (PGSizer)
📰

Why max_connections=500 Killed Our DB: Production Sizing & Config Guide (PGSizer)

DEV Community: postgres·Chi Hoang·7 days ago
#b6lIU9hU
Long article (805 words) — no AI summary yet.
Reading 0:00
15s threshold

Production Sizing Summary (PGSizer — Why max_connections=500 Killed Our DB): shared_buffers = 25% RAM | Pool via PgBouncer

Legacy Bottleneck: Managed RDS + OOM Spikes ($265/mo (3,000 IOPS Cap))

Right-Sized Target: Tuned KVM + PgBouncer ($19.99/mo (32GB NVMe))

Interactive Browser Calculator & 1-Click Config: PGSizer — Why max_connections=500 Killed Our DB

1. Real-World Incident Post-Mortem

At 02:14 UTC during a payroll batch, a 16GB PostgreSQL 17 primary vanished with kernel SIGKILL after max_connections=500 collided with work_mem=64MB across parallel hash joins.

Each analytical query spawned four parallel workers with three hash and sort nodes, so 65 active sessions allocated over 15GB of private heap and forced OOM-Killer onto postmaster.

Capping max_connections at 80 behind PgBouncer transaction pooling and lowering work_mem to 16MB stabilized p99 latency at 8ms on a $19.99/mo Hostinger KVM 8 NVMe server.

2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.