External Proxies and Poolers - A reality check in todays tech stack
summary
Modern Linux makes process creation cheap—simple C tests hit >10,000 forks/sec and Postgres can fork ~2,000 new backends/sec—so the real limits are network latency and authentication overhead, not forking. Benchmarks show a single connection can do ~60,000 qps at 0.017 ms but drops dramatically as latency rises; cloud edges sit near 0.2 ms. pgbench and pgGather surface client_read and net_delay; pgBouncer examples hit ~97 TPS with SCRAM, while an application-native pooler gets 1:400 multiplexing. External proxies break channel binding unsupported, add MITM risk, complicate troubleshooting, and stackable poolers can leak open transactions; Postgres 19 wait_for_lsn also blocks backends behind proxies.
AI-written summary · about
chapters (18)
- 0:00Introduction and context
- 2:35PostgreSQL culture and proxies
- 6:51Human perception vs latency reality
- 10:19Network latency impact on performance
- 12:51Measuring latency with wait events
- 15:18Query pipelining and throughput
- 16:40Benchmarking poolers and trade-offs
- 18:52Authentication overhead and security
- 20:38Security risks of external proxies
- 23:26Channel binding and TLS limitations
- 25:53Weakest link in proxy chains
- 26:57Availability and maintainability issues
- 29:04Complexities of stacking poolers
- 31:33Troubleshooting and forking process
- 34:44Debunking forking process myths
- 36:06Application-side pooling benefits
- 37:54Simpler alternatives to proxies
- 38:36Postgres 19 wait for LSN feature
related talks
20mElephant by the pool: PostgreSQL connection poolers overview
44mPgBouncer and 20000 TPS at one node: advanced tuning, hacks and problem solving
36mBest Practices in PostgreSQL Tuning: Navigating Key Performance Bottlenecks in the Cloud
46mPgBouncer Connection Pooling and Routing
51mConnection pooling routing and queueing with pgBouncer
27mThe world's worst pool party: Connection management with Prisma
13mA Deep Dive into the DB Connection Pool
51mScaling Postgres to the next level at OpenAI
