Thread Pool Calculator
Size a thread pool from the ratio of waiting to computing time.
About Thread Pool Calculator
CPU-bound work needs roughly one thread per core, while IO-bound work needs many more because threads spend most of their time waiting. The blocking coefficient is what distinguishes the two cases. Oversizing a CPU-bound pool causes context-switch thrashing, while undersizing an IO-bound pool leaves cores idle — the failure modes are opposite.
Formula
Thread Pool
Pool size = cores × target utilisation × (1 + wait time ÷ compute time)
- blocking coefficient
- Ratio of waiting time to CPU time per task
Worked example
With the default values below, Thread Pool Calculator returns Recommended Thread Pool Size of 43. Change any input above and every figure here is recalculated in your browser.
Inputs used
- CPU cores availableminimum 1
- 8
- CPU time per taskminimum 0.001 ms
- 15 ms
- Waiting time per taskminimum 0 ms
- 85 ms
- Target CPU utilisationaccepts 0–100 %
- 80 %
Results
- Recommended Thread Pool Size
- 43
- Blocking Coefficient
- 5.6667
- Maximum Throughput
- 430.0 tasks/s
- Pool Size if Purely CPU Bound
- 9
- Workload Type
- IO bound — a much larger pool than the core count is appropriate
Step by step
- 1Values used
- 2Thread Pool
- 3Recommended Thread Pool Size= 43
- 4Blocking Coefficient= 5.6667
- 5Maximum Throughput= 430.0 tasks/s
- 6Pool Size if Purely CPU Bound= 9
- 7Workload Type= IO bound — a much larger pool than the core count is appropriate
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is Thread Pool calculated?
Pool size = cores × target utilisation × (1 + wait time ÷ compute time) CPU-bound work needs roughly one thread per core, while IO-bound work needs many more because threads spend most of their time waiting. The blocking coefficient is what distinguishes the two cases.
Why does Thread Pool matter?
Oversizing a CPU-bound pool causes context-switch thrashing, while undersizing an IO-bound pool leaves cores idle — the failure modes are opposite.
What values do I need to enter?
This calculator takes 4 inputs: CPU cores available, CPU time per task, Waiting time per task, Target CPU utilisation. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
