Frequently Asked Questions
Why does the pool size not change when I raise requests per second?
Because the engine's pool formula uses only database cores: 2 times cores plus 4. Request rate and latency feed the Little's Law line and the burst line, never the pool. At 1800 requests per second the concurrency rises to 63, yet the pool stays at 36. That is by design: the core rule describes what the database can run in parallel, not what the clients want. Use the Little's Law line to check the clients.
Should I enter latency in milliseconds or seconds?
Milliseconds. The engine divides the latency field by 1000 before multiplying by the request rate. Typing 0.035 when you mean 35 ms gives a concurrency a thousand times too small, and the page does not warn you. A quick check is that 1200 requests per second at 35 ms should give 42 in flight.
Can I set the spindle term to zero for an SSD database?
Not on this page. The plus 4 is fixed in the engine even though the formula shows it as a variable. For cloud or SSD storage, subtract 4 from the total yourself. On 16 cores that gives 32 rather than 36. The difference rarely matters much, since the load test that follows will tune the number anyway.
Does the 2.5 times burst figure come from real percentiles?
No. The label says 99th percentile, but the engine just multiplies average concurrency by 2.5, turning 42 into 105 concurrent. It is a fixed headroom factor that ignores how bursty your own traffic really is. If you have request rate and latency data per second, take the highest value of rate times latency from that data to get a real peak, and compare it with the page's figure.
How do I size a thread pool from this?
Use the Little's Law figure with full request latency for a blocking thread-per-request server, then add headroom for bursts, for which the 2.5 times line is one rough guide. For the defaults that is 42 on average and 105 with the multiplier, across all pods. Divide by the pod count for a per-instance figure. Async servers need far fewer threads.
What if my per-pod pool times pods exceeds the total?
That happens only when there are more pods than recommended connections, because the engine never gives a pod fewer than 1. At 48 pods on 16 cores each pod gets 1, totalling 48 against 36. Well before that point, at 24 pods with one connection each, pods start queueing internally. A pooler such as PgBouncer between the pods and the database solves both problems.
Is Little's Law valid for bursty traffic?
Yes for long-run averages, as long as the system is stable and the queue is not growing without limit. It says nothing about short peaks, which is why the page adds a burst line. For capacity planning, apply it to the busiest sustained interval you see, such as the peak minute, rather than a daily average that hides the load.
Why is a smaller pool sometimes faster?
A database can only execute about as many queries at once as it has cores, plus a little for I/O waits. Extra connections queue inside the database, competing for locks, memory and CPU time, and context switching overhead grows. Keeping the active pool near 2 times cores plus a small allowance, 36 on the default, usually keeps throughput high and tail latency lower.
Does the database CPU count include hyperthreads?
The field asks for vCPU cores, which on most cloud instances already counts hyperthreads. The original rule of thumb was written for physical cores, so on a hyperthreaded instance the figure may run a little high. That is another reason to treat 36 on 16 vCPUs as the opening point for a load test rather than a final setting.
What about read replicas?
Each database server has its own core count and its own pool limit. Run the calculator once per server, using that server's cores and the share of traffic it receives. A primary with 16 cores and two replicas of 8 cores each would get 36, 20 and 20 active connections respectively, based on the engine's formula. Check each against its own max_connections setting as well.
Two separate answers from one form
This calculator puts two different sizing rules on one screen, and it helps to see early that they do not talk to each other. The first is Little's Law: average concurrency equals arrival rate times time in the system. The second is the PostgreSQL rule of thumb for an active connection pool: twice the database's CPU cores plus a spindle allowance. The engine computes both, but the pool figure never uses your request rate or latency.
With the defaults, 1200 requests per second at 35 ms average latency, Little's Law gives 42 requests in flight on average. The 16-core database gets a recommended total of 36 active connections, split across 6 application pods as 6 connections per pod. The page also prints a burst figure of 105, which is simply 2.5 times the 42.
Read them as two lenses on the same system. Little's Law tells you how much work is in progress at any moment, which sets thread pool and worker counts. The core formula tells you how many connections the database can usefully run at once before extra connections only add contention.
Working L = λW by hand
Little's Law needs the rate and the time in the same units. The engine converts milliseconds to seconds by dividing by 1000, so 35 ms becomes 0.035 s, and 1200 times 0.035 is 42. You can check any run the same way, and you should, because the most common mistake on this page is entering latency in seconds into a field that expects milliseconds.
The relationship is linear in both inputs. The Lower preset at 720 requests per second gives 25.2 in flight; the Higher preset at 1800 gives 63. Doubling latency to 70 ms at the default rate doubles concurrency to 84. That last case is the one people forget: a slow dependency raises concurrency just as surely as a traffic spike, and it usually arrives without any change in the request graphs.
Little's Law holds for averages in a stable system, whatever the arrival pattern, provided the system is not building an ever-growing queue. If arrivals exceed what the service can complete, latency keeps climbing and the formula describes a moving target rather than a steady state.
Where the 36 connections come from
The pool figure is (2 times cores) plus 4. With 16 cores that is 32 plus 4, or 36. The 4 is a fixed spindle allowance written into the engine. The formula on the page names it DiskSpindles, but there is no input for it, so you cannot set it to zero for an SSD-backed or cloud database where the old spindle idea does not really apply.
Halving the database to 8 cores drops the total to 20 connections and the per-pod figure to 3. Doubling the pods to 12 on the default 16 cores also gives 3 per pod, because the engine divides the 36 by the pod count and rounds down. With 4 pods you get 9 per pod.
The core-based rule exists because a database with 16 cores can only execute about that many queries truly in parallel. Beyond a modest multiple, extra connections spend their time waiting on locks, I/O and CPU scheduling, and throughput often falls as the pool grows. That is the reason the recommended pool is far smaller than many teams expect.
When 42 in flight meets a pool of 36
On the defaults the Little's Law figure, 42, is larger than the pool, 36. The page does not flag this, so it is worth thinking through. If every one of those 42 requests held a database connection for its full 35 ms, the pool would be short and requests would queue for a connection.
In most services they do not. The 35 ms is end-to-end API latency, and the time a request actually holds a connection is a slice of that. If the database work takes 10 ms of the 35, the concurrency that matters for the pool is 1200 times 0.010, which is 12, comfortably inside 36. Run the calculator a second time with the query time in the latency field to get that figure directly.
So use the latency field deliberately. Enter full request latency when you are sizing web server threads or async workers. Enter connection hold time, from your pool metrics, when you are checking the database pool. Mixing the two is the single biggest source of oversized pools.
The 2.5 times burst line is a fixed multiplier
The third supporting line is labelled 99th-percentile burst concurrency, and the label oversells it. The engine does not model a distribution or read any percentile. It multiplies the average concurrency by 2.5, so 42 becomes 105 and 63 becomes 157.5. Treat it as a generic headroom allowance, not a measured tail.
Whether 2.5 is enough depends on your traffic. A service whose traffic arrives in tight bursts, such as a batch job firing at the top of the minute, can see short peaks well beyond that. A smooth, high-volume API may never get close. If you have a latency histogram and per-second request counts, compute the peak of rate times latency from real data instead.
The burst figure is most useful for thread pools and queue limits. It is not a recommendation to raise the database pool to 105, which would undo the point of the core-based rule.
Pods, rounding and a pool floor of one
The per-pod figure is the total divided by pods, rounded down, with a minimum of 1. Rounding down keeps the fleet at or below the total while there are no more pods than connections. With 24 pods on the default 16 cores, each pod gets 1 connection, 24 in all, comfortably inside the recommended 36 but leaving 12 unused. Once pods outnumber the total, the floor of 1 pushes the fleet over: 48 pods each holding 1 connection add up to 48 against 36.
So when your pod count is large relative to cores, multiply the per-pod answer by the pod count yourself and compare it with the total. A single connection per pod also means one slow query blocks every other request in that pod. The usual fixes are a connection pooler such as PgBouncer in front of the database, so that many application connections share a small number of server connections, or fewer, larger pods.
Remember autoscaling too. The pod count you enter is a snapshot. If the deployment can scale from 6 to 12 pods under load, size the per-pod pool for the maximum, or the database sees twice the connections exactly when it is busiest.
Entry mistakes that skew the answer
Peak, not average, belongs in the request rate field. The label says peak requests per second for a reason: a daily average can hide a lunchtime peak two or three times higher, and sizing to the average guarantees queueing at exactly the moment users are busiest. Take the rate from the busiest sustained minute in your metrics, not the busiest single second and not a whole-day mean.
Use the mean latency for Little's Law, not the 99th percentile. The law is exact for averages, and plugging a tail latency into it overstates typical concurrency by whatever ratio separates your p99 from your mean. If you want a pessimistic figure, the burst line already applies a multiplier, and stacking a tail latency on top of that double counts the same risk.
Count only the replicas that talk to this database. If a reporting service and a web tier share the same PostgreSQL primary, both sets of pods draw from the same 36 connections. Enter the combined pod count, or divide the total between the services by hand before setting each one's pool. Background workers and cron jobs are easy to forget and often hold connections far longer than web requests do.
Finally, check the units of the core count against what your provider calls a core. A managed database listed as 16 vCPUs is what the field expects. A dedicated server with 16 physical cores and hyperthreading would show 32 logical CPUs in the operating system, and entering 32 would double the recommended pool to 68 against the 36 the original rule intended.
Using the answer in a capacity review
A sensible order is to run the defaults with your own numbers, then run it again with connection hold time in the latency field, then compare per-pod times pods with the total. That gives three checks: how much work is in flight, whether the database pool covers the connection-holding part of it, and whether the fleet respects the database's limit.
Then load test. Formulas like these are starting points, and the real optimum depends on query mix, lock contention and storage. Start with the recommended pool, raise it in small steps under realistic load, and stop when throughput stops improving or tail latency starts rising. Leave the setting there and note why, so the next person does not double it on instinct during an incident.
Write the inputs down alongside the result: the request rate, which latency you used and where it came from, the core count, and the pod count including any autoscaling maximum. A pool size with no recorded reasoning tends to get doubled during the next outage, and a written note showing that 36 connections was chosen against 16 cores and 12 in-flight queries is the easiest way to stop that from happening.