Concurrency Calculator

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

Use the Concurrency Calculator

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

Concurrency Calculator applies Little's Law — N = λ × W — to determine how many concurrent workers (threads, goroutines, or connections) a service needs to sustain a target throughput at a given average latency. It compares the theoretical minimum against the practical CPU-bound ceiling, flags over-provisioning, and shows a scaling table so you can plan fleet size before hitting production.

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-06-19 · Reviewed by Nham Vu