IT lexicon › Database › Connection pool

Connection pool

Database På svenska → Updated: 2026-07-29

A set of ready database connections the application borrows and returns instead of opening a new one per query. Almost always the first thing to fix when a web app feels slow.

Establishing a connection costs a TCP handshake, a TLS negotiation and authentication — and in PostgreSQL, additionally a new operating system process with its own memory. Doing that per HTTP request is pure waste. The pool keeps a fixed number of connections warm and queues requests that don't fit. More is not better. A pool larger than the database has cores and disks for produces more lock contention and context switching, not more work done; the rule of thumb often lands around twice the core count. HikariCP is the standard on the JVM, PgBouncer the external pooler for Postgres — necessary when serverless functions open hundreds of short-lived clients.

← Back to the lexicon