Connection pooling routing and queueing with pgBouncer
summary
pgBouncer reduces connection overhead dramatically: 10,000 connects: 24s → 4s and with a small query 27s → 6s, while a long-lived session with 100k selects shows extra hop overhead (6.8s direct vs 11s via pgbouncer). It implements pooling/queuing with pool, reserve and timeout settings, supports admin commands like show pools and pause/resume, and does online restart via -R by transferring file descriptors. Version 1.7 adds TLS, pg_hba-style rules and PAM; configuration must keep pool sizes consistent across layers.
AI-written summary · about
chapters (11)
- 0:00Connection pooling, routing, and queuing with PgBouncer
- 0:26PgBouncer quick intro
- 1:01PgBouncer configuration
- 8:05Connection queuing
- 15:32Connection routing
- 24:27Connection maintenance
- 28:17Online PgBouncer restart
- 29:34Security
- 31:50Pain points
- 37:05Resources
- 39:08Online PostgreSQL restart
related talks
53mPgBouncer: Present and Future
20mElephant by the pool: PostgreSQL connection poolers overview
59mComparing Connection Poolers for PostgreSQL
42mDo it in SQL: pgbouncer_wrapper
44mPgBouncer and 20000 TPS at one node: advanced tuning, hacks and problem solving
23mComparing Postgres connection pooler support for prepared statements
25mFollow my Leader connecting Postgres client applications after server failover
13mA Deep Dive into the DB Connection Pool
