In this lesson · topic 4 of 7
Topic 4
A pool that is too small
4 min read
Sizing from the rate
A connection that serves one request at a time can finish a request every 90 ms in the lab. At 200 requests a second, about 18 requests are in service at any moment. That is the number of busy connections. Anything below it falls behind.
With HTTP/1.1 and a pool of 8, the queue held 728 requestsmeasured after 600 ticks, and the 99th percentile latency was 3610 msmeasured. With a pool of 32, nothing queued and the 99th percentile was 90 msmeasured, one round trip plus the work.
There is no gentle middle. When the arrival rate is above what the pool can serve, the queue grows for as long as the overload lasts. When it is below, the queue stays empty. A pool a little too small is much worse than a pool a little too large.
The other limit
A bigger pool is not free. Each connection holds memory on both ends, and a thousand clients with 32 connections each is 32,000 connections on the server. Keep the pool near what the rate needs, with some headroom for bursts, and count the total across all clients.