Managing finite resources.
WHAT A CONNECTION POOL IS
A set of database connections reused across requests.
WHY IT EXISTS
Establishing a connection is expensive, and databases limit how many they accept.
WHAT TO CONFIGURE
Pool size Timeout waiting for a connection Maximum connection lifetime
WHAT HAPPENS WHEN THE POOL IS EXHAUSTED
Requests wait, then fail.
WHAT CAUSES EXHAUSTION
Connections not returned Long-running queries holding connections Pool sized too small for concurrency
WHAT TO BE CAREFUL WITH
Several application instances, each with its own pool, exceeding the database limit in total.
WHAT THAT MEANS
Pool size multiplied by instance count must remain within what the database accepts.
WHAT ELSE TO LIMIT
Concurrent external calls Memory per process Request body size Upload size
WHY LIMITS AT ALL
An unbounded resource is exhausted eventually, and the failure is severe.
WHAT TO MONITOR
Pool utilisation, wait times, and connection errors.
WHAT TO ALERT ON
Sustained high utilisation, which precedes failure.