Concurrency Calculator

Enter target throughput, average latency, and CPU core count to calculate the ideal thread pool size using Little's Law (N = λ × W).

Service Parameters

Little's Law: N = λ × W

Requests per second the service must sustain at steady state.

End-to-end time per request including DB, network, and downstream calls.

Logical cores (vCPUs) available to the service process.

Advanced

Extra headroom above the Little's Law minimum. Recommended: 20–30%.

Fraction of each request's time spent on CPU (not waiting). I/O-heavy: 0.05–0.20. CPU-heavy: 0.70–1.0.

Little's Law Result

Min Concurrency (N)
threads / workers
Recommended Pool
with 25% buffer

Set your parameters and click Calculate

Summary

Enter target throughput, average latency, and CPU core count to calculate the ideal thread pool size using Little's Law (N = λ × W).

How it works

  1. Enter the target throughput (requests per second) your service must sustain.
  2. Enter the average end-to-end latency per request in milliseconds (include DB and downstream wait time).
  3. Enter the number of CPU cores available to the service process.
  4. Optionally set a safety buffer (%) to add headroom above the Little's Law minimum.
  5. Read the recommended pool size, the CPU-bound ceiling, and the utilization breakdown.

Use cases

  • Size a thread pool for a new microservice before the first load test.
  • Diagnose thread starvation: if your pool is smaller than N = λ × W, queuing latency compounds.
  • Prevent over-provisioning: a pool much larger than the CPU ceiling wastes memory and increases context-switch overhead.
  • Plan connection pool limits for database drivers (HikariCP, pgBouncer, SQLAlchemy).
  • Model the concurrency impact of a 2× latency regression without changing throughput targets.
  • Compare thread vs. goroutine concurrency needs for the same workload.

Frequently Asked Questions

Last updated: 2026-07-01 · Reviewed by Nham Vu