What problem does a connection pool primarily solve?
Connection pool: maintains a set of reusable open connections, avoiding the costly TCP and authentication handshake on every request.
2 / 5
What happens when the pool is exhausted and all connections are in use?
Pool exhaustion: additional requests block until a connection frees up or a configured acquisition timeout fires. Sizing the pool correctly avoids cascading latency.
3 / 5
Why can an oversized pool actually hurt a database?
Oversizing: databases have limited CPU/IO; too many active connections increase lock contention and scheduling overhead, often reducing throughput. A modest pool near core count is typical.
4 / 5
What is the role of an external pooler like PgBouncer?
PgBouncer: sits between clients and PostgreSQL, sharing a small set of server connections among many clients (e.g. transaction pooling), critical for serverless and high-fan-out apps.
5 / 5
What is a connection leak?
Connection leak: code that borrows a connection and fails to release it (often missing a finally/close), gradually draining the pool until requests stall.