# Connection pool sizing is a queueing theory problem, not a tuning knob

DevFeed: [Connection pool sizing is a queueing theory problem, not a tuning knob](<https://devfeed.tech/articles/connection-pool-sizing-is-a-queueing-theory-problem-not-a-tuning-knob-39593.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/41-connection-pool-sizing-queueing-theory/>)

Author: hello@ankit-rana.com

Published: 2026-08-22T00:00:00Z

Content type: article

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [connection pool](<https://devfeed.tech/topics/connection-pool.md>), [queueing theory](<https://devfeed.tech/topics/queueing-theory.md>), [Latency](<https://devfeed.tech/topics/latency.md>), [Database](<https://devfeed.tech/topics/database.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [capacity-planning](<https://devfeed.tech/tags/capacity-planning.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [connection-pool](<https://devfeed.tech/tags/connection-pool.md>), [cpu](<https://devfeed.tech/tags/cpu.md>), [database](<https://devfeed.tech/tags/database.md>), [database-performance](<https://devfeed.tech/tags/database-performance.md>), [hikaricp](<https://devfeed.tech/tags/hikaricp.md>), [inference](<https://devfeed.tech/tags/inference.md>), [latency](<https://devfeed.tech/tags/latency.md>), [network](<https://devfeed.tech/tags/network.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [query](<https://devfeed.tech/tags/query.md>), [queueing-theory](<https://devfeed.tech/tags/queueing-theory.md>)

## AI overview

This article explains how to size a connection pool using Little's law: concurrency equals throughput multiplied by connection holding time. It argues that increasing the pool beyond the database's parallel execution capacity can move the queue, increase latency, and leave throughput flat. It also identifies excessive holding time from network round trips, N+1 queries, long transactions, and model inference calls as common causes of pool exhaustion.

## Source excerpt

Pool size follows from Little's law: concurrency equals throughput multiplied by holding time, so 500 requests per second each holding a connection for 20ms needs ten connections rather than a round number someone picked. Past the point where the database can execute requests in parallel, adding connections moves the queue rather than removing it, and latency grows while throughput stays flat. The number that actually reaches the database is the pool size multiplied by the instance count, which is usually the number nobody has calculated.