Size a database connection pool from throughput, query time and instance count.
Required concurrency follows from throughput multiplied by query duration, then divides across instances. Total connections scale with instance count, which is what makes horizontal scaling exhaust the database limit. Oversized pools hurt rather than help, because a database serving more concurrent queries than it has cores spends the difference on context switching.
Database Connection Pool
Concurrency = requests per second × query time, which is Little's Law
Concurrency = requests per second × query time, which is Little's Law Required concurrency follows from throughput multiplied by query duration, then divides across instances. Total connections scale with instance count, which is what makes horizontal scaling exhaust the database limit.
Oversized pools hurt rather than help, because a database serving more concurrent queries than it has cores spends the difference on context switching.
This calculator takes 5 inputs: Requests per second, Average query time, Application instances, Database connection limit, Headroom for spikes. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.