We scaled PgBouncer to 4x throughput

Engineers at ClickHouse improved PgBouncer throughput by 4x by moving from a single-threaded process to a multi-process fleet architecture. They utilized so_reuseport to distribute connections across CPU cores while implementing peering to handle query cancellations correctly.
Why it matters
Optimizing database connection pooling is critical for scaling high-performance web applications and managing infrastructure costs effectively.
PgBouncer is single-threaded. A single process uses one CPU core, no matter how many the machine has. On a 16-vCPU box that means one core does all the connection pooling while the other fifteen sit idle, and the pooler starts capping throughput long before Postgres runs out of room.
The content is a technical engineering case study with no political or social bias.
Get smarter about the news
Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.
Create free accountAlready have an account? Sign in