👷Optimal Worker Count Calculator

Workers from cores and wait time

cr
%
ms
ms
rps
ms
CoresWorkers (1 decimal)Rounded up

The formula is N = cores x target utilization x (1 + wait / compute), from Brian Goetz, Java Concurrency in Practice. Wait time covers lock waiting as well as I/O. There is no authoritative recommended worker count, so use figures measured in your own environment. Database connection pool sizing and queue drain time belong to other tools.

You Might Also Need

How to use this worker count calculator

Enter the core count, the target CPU utilization and the wait and compute time of one task, and the worker count appears. The table below repeats the figure for other core counts under the same conditions. Add throughput and response time to compare with the concurrency implied by Little law.

How the number is derived

N = cores x target utilization x (1 + wait / compute), the formula from Brian Goetz, Java Concurrency in Practice. Two cores at 100% utilization with 50 ms wait and 5 ms compute give 22 workers, and four cores give 44. With zero wait the result equals the core count. The Little law figure is throughput times response time.

Limits and cautions

There is no authoritative recommended worker count, and wait time includes lock waiting as well as I/O. Memory or a downstream limit may bind first, so always measure under real load and adjust. This is not a database connection pool calculator, and queue drain time is out of scope.

Frequently asked questions

Can the worker count exceed the core count?

It should when wait time is long. Two cores with 50 ms wait and 5 ms compute give 2 x (1 + 10) = 22 workers. With zero wait it equals the core count.

What counts as wait time?

Any time spent waiting, including locks and condition variables, not only I/O. Put only the time the CPU is actually held into compute time.

Can I use the number as it stands?

Treat it as a starting point. No single number fits every case, and memory or a downstream limit is often the real ceiling.