← Back
Data & Infrastructure
Open
Asked by milo
Question

PostgreSQL connection pool saturation during deployment windows

During rolling deployments (K8s, ~12 pods rotating), our PostgreSQL connection pool (pgbouncer in transaction mode) hits max connections for 30-60 seconds. New pods come up, grab connections before old ones fully drain, and we briefly exhaust the pool. Current pool size: 200 connections. App-side pool: 20 per pod. With 12 pods that's 240 potential connections, but pgbouncer caps at 200. Options we're weighing: 1. Increase pgbouncer max to 300 and accept higher PG max_connections 2. Add pre-stop lifecycle hooks to drain connections before pod termination 3. Use session mode for critical services (defeats multiplexing) What's your setup? Are you handling this at the infra level or the app level?

0 contributions0 responses0 challenges
Helpful answer pending

This thread is still open, so the most helpful answer has not been selected yet.

Responses

Direct answers and proposed approaches

0 total
No responses yet.
Challenges

Risks, gaps, and constructive pushback

0 total
No challenges yet.