Skip to main content

Thread Pool Size Calculator

Calculate the optimal thread pool size from CPU core count, task type (CPU-bound, IO-bound, or mixed), and blocking coefficient. Shows the exact formula, a step-by-step derivation, and the Amdahl's Law speedup limit for CPU-bound work.

Input

Number of logical CPU cores available to the process.

Ratio of wait time to service (compute) time per task. 0 = pure CPU work, 10 = almost entirely waiting (e.g. a slow downstream API).

Output

Optimal Thread Pool Size
MetricValue
No data yet
Was this helpful?

Guides

Turn "how big should my thread pool be?" into an actual number. Enter your CPU core count and pick whether the work is CPU-bound, IO-bound, or mixed, and this calculator applies the standard sizing formula — showing every step, not just the final answer.

How to use it

  1. Set CPU Cores (N) to the number of logical cores available to your process.
  2. Pick a Task Type. CPU-bound work (image processing, encoding, number crunching) behaves very differently from IO-bound work (HTTP calls, database queries, disk reads).
  3. For IO-bound or Mixed, drag the Blocking Coefficient (W/S) slider — the ratio of time each task spends waiting versus actually computing. A task doing a 40ms compute step between two 200ms network calls has a blocking coefficient around 10.
  4. Read the Optimal Thread Pool Size at the bottom of the derivation table, along with the formula and every intermediate step used to get there.

The formulas

  • CPU-bound: pool = N + 1 — one thread per core, plus one so a brief pause (a page fault, a GC pause) doesn't leave a core idle. This is the sizing convention used by Java's ForkJoinPool.commonPool() and most compute-oriented executor guides.
  • IO-bound: pool = ceil(N × (1 + W/S)) — the standard blocking-coefficient formula (Brian Goetz's Java Concurrency in Practice, and the same shape used in Netty/Tomcat worker-pool sizing guides). Each thread spends most of its time blocked, so you need more threads than cores to keep every core doing useful work while others wait.
  • Mixed: the blend of both estimates, ceil((CPU-bound estimate + IO-bound estimate) / 2) — a reasonable middle ground for workloads that are part compute, part waiting, without inventing a third formula.

Amdahl's Law (CPU-bound only)

For CPU-bound work, adding threads past N + 1 rarely helps — a real workload always has some inherently serial portion (setup, coordination, a single-threaded merge step) that no amount of parallelism removes. Set the parallelizable portion slider to see the theoretical speedup ceiling: speedup(N) = 1 / ((1 - P) + P / N), where P is the fraction of work that can run in parallel. The panel also shows the absolute maximum speedup as core count goes to infinity — a useful sanity check before provisioning a machine with far more cores than your workload's serial fraction can actually use.

Privacy

Everything runs in your browser — nothing you enter is sent anywhere.

Related tools

Tuning throughput on the IO side too? The Rate Limit Calculator converts an API rate limit into per-worker delays and staggered start offsets across a multi-worker pool. If you're sizing infrastructure around request timing, the Network Latency Calculator helps estimate round-trip time budgets.

optimal thread countconcurrency sizingworker pool sizelittle's lawamdahl's lawblocking coefficientexecutor servicejava concurrencycpu bound vs io boundserver capacity planning

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/thread-pool-size-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cpuCores": "8",
    "taskType": "cpu",
    "blockingCoefficient": "4",
    "parallelizableFraction": "95"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `thread-pool-size-calculator` tool (Thread Pool Size Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.