Northbound Systems

Engineering notes on backend systems, databases, and small infrastructure.

Connection Pooling, Honestly

September 12, 2026 · Backend

Every few months someone on a team proposes adding a connection pooler as if it were a free upgrade. It is not free, and it is not exactly an upgrade. A pooler trades latency distribution for connection count. Whether that trade helps depends entirely on where your bottleneck actually sits — and most teams have not measured that before reaching for the tool.

What a pooler actually buys

A database connection is expensive in two currencies: memory on the server (several megabytes each, before any query runs) and scheduling contention once thousands of them are nominally "active." If your application tier opens 2,000 connections to a database that can productively run 40 queries at once, 1,960 of those connections are a queue you built yourself, in the least observable place possible. A pooler in transaction mode collapses that queue into the pooler, where you can at least see it.

What it costs

Transaction pooling breaks anything session-scoped: prepared statements (unless your pooler handles them), advisory locks, SET variables that must survive across statements, and temp tables. Each of these fails in a distinctive, confusing way — usually in production, usually weeks after the pooler went in, when someone ships the first feature that needed a session feature.

The experiment we run

Before deploying a pooler we sweep pool sizes against a replayed workload. On our rig, throughput stopped improving at roughly 2× core count, and past 3× the tail latency got worse — more connections meant more lock contention, not more work done. The pool size question has an empirical answer for every workload; it is never "as many as the app wants."

Poolers are good tools. They are just not performance tools — they are admission control, and they work best when you treat them that way: small pool, visible queue, honest backpressure.

← All articles