Connection Pool Sizing Calculator

Calculate the optimal database connection pool size using the HikariCP formula and Little's Law analysis.

HikariCP Formula Inputs

Physical or virtual cores available to the database server.

Use 1 for SSD / NVMe. Use the number of physical spinning disks for HDD arrays.

Little's Law Inputs (optional)

Maximum number of requests hitting the database simultaneously.

Mean time a single query occupies a connection, in milliseconds.

Deployment Scale

How many application server instances share the database.

HikariCP Formula

pool = (cores × 2) + spindles

Little's Law

L = concurrency × (query_ms / 1000)

Enter Peak Concurrent Requests and Average Query Duration to enable.
Copied!

Summary

Calculate the optimal database connection pool size using the HikariCP formula and Little's Law analysis.

How it works

  1. Enter your database server's CPU core count and storage spindle count (use 1 for SSD or NVMe).
  2. Optionally add Little's Law inputs: peak concurrent requests per second and average query duration.
  3. The tool applies the HikariCP formula (cores × 2 + spindles) and, if provided, the Little's Law concurrency size.
  4. Compare both results and use the higher value as a safe starting pool size, then load-test and tune.

Use cases

  • Sizing a HikariCP pool for a Spring Boot or Java service.
  • Tuning PostgreSQL max_connections alongside PgBouncer pool size.
  • Estimating connection requirements before a production launch.
  • Diagnosing connection exhaustion or idle-connection waste.
  • Capacity planning when scaling from one to multiple app servers.

Frequently Asked Questions

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