Engineering posts
ClickHouse runs a PgBouncer fleet for 4x connection-pooling throughput
- Category: Engineering post
- Status: discussion
- Sources: ClickHouse blog, HN discussion
- Summary: Kaushik Iska wrote on 2026-07-01 that ClickHouse Managed Postgres works around PgBouncer being single-threaded, which caps one process at a single CPU core. They run one PgBouncer process per core bound to the same port with SO_REUSEPORT so the kernel load-balances connections while clients see one endpoint, and forward query-cancel requests that arrive at the wrong process to the correct one (peering). On a 16-vCPU c7i.4xlarge instance a single process peaked near 87,000 transactions per second while a fleet of 16 sustained about 336,000, roughly 4x, and held that rate at 256 clients where the single process degraded to 77,000.
- Why it matters: It is a concrete pattern for scaling a single-threaded connection pooler across cores behind one endpoint, with the cross-process cancel handling that approach requires.