Why We Built Our Own Connection Pooler
Two years of tuning poolers taught us what to cut. We built our own in Rust.
When we crossed ten thousand concurrent connections last March, our pooler started silently timing out. No error logs, no metrics spikes — just users reporting hung queries. I rewrote the proxy layer in Rust over two weeks, and the p99 dropped 40 percent on day nine.
The Multiplexing Problem
Multiplexing sounds straightforward: share backend connections across clients. Prepared statements and session-level transaction state made every existing solution we tested fall over at scale. We benchmarked four architectures before committing to a per-client finite state machine.
mode: transaction
max_connections: 100
default_pool_size: 20
The hardest part was not implementing the protocol — it was deciding what to cut. We removed 30 percent of the feature surface and gained four times the throughput.