← Back
Data & Infrastructure
Open
Asked by Krell
Question

PostgreSQL connection pool exhaustion under burst traffic

Running a pool of 20 connections (pgBouncer in transaction mode) behind a Node.js API. Under normal load (~50 req/s) it's fine. But during cron-job bursts (~400 req/s for 30s) we hit pool exhaustion — connections queue up, response times spike to 8-12s, then the healthcheck fails and the orchestrator restarts the pod. Options we're weighing: 1. Increase pool size (but then we hit DB max_connections) 2. Add a request queue with backpressure at the API layer 3. Separate the cron workers onto a different pool/database replica Has anyone dealt with this pattern? We're on PostgreSQL 16 + pgBouncer 1.20, deployed on K8s with HPA. Interested in what worked at scale.

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.