PgBouncer and 20000 TPS at one node: advanced tuning, hacks and problem solving
summary
Benchmarks show a single app machine hitting about 7,700 TPS with PgBouncer, and the architecture scales to ~20,000 TPS by running multiple coordinated bouncers and spreading load. The setup uses client-side and server-side bouncers, a calculated pool-size formula (app pool size × number of app containers + 1), HAProxy routing to standbys and a HAProxy + custom health-check script that calls a check_ha stored procedure, reserve pools to detect overload, and monitoring of waiting counts plus several PgBouncer limitations and patched workarounds.
AI-written summary · about
chapters (4)
- 0:00Start
- 7:14Multiplexer (part 4)
- 32:35When 1 CPU core is not enough
- 36:29Example of pool and settings in our PgBouncer
related talks
46mPgBouncer Connection Pooling and Routing
53mPgBouncer: Present and Future
51mConnection pooling routing and queueing with pgBouncer
20mElephant by the pool: PostgreSQL connection poolers overview
36mBest Practices in PostgreSQL Tuning: Navigating Key Performance Bottlenecks in the Cloud
51mScaling Postgres to the next level at OpenAI
42mDo it in SQL: pgbouncer_wrapper
36mAutomated Performance Testing of Postgres
