RDS Connection Limit Estimator
Calculate connection safety for PostgreSQL, MySQL, and MariaDB deployments. All logic runs client-side; share scenarios via URL.
Inputs
Apply a preset to populate common pool sizing scenarios.
Learn how this works
Why this service exists
This estimator helps prevent "too many connections" incidents when horizontal scaling increases app pods and each pod opens its own DB connection pool.
How calculations work
- PostgreSQL:
min(floor(memory_bytes / 9531392), 5000) - MySQL:
floor(memory_bytes / 12582880) - MariaDB 10.4:
floor(memory_bytes / 12582880) - MariaDB 10.5+:
min(floor(memory_bytes / 25165760), 12000) - Usable connections:
floor(max_connections * (1 - headroom)) - reserved - Total needed connections:
pods × pool size
AWS DBInstanceClassMemory differs from raw GiB due to reserved memory; values are estimates.
What each input means
- Engine: selects formula family and behavior.
- MariaDB version: selects 10.4 or 10.5+ default formula.
- Instance class / memory: defines memory baseline for estimation.
- Custom max_connections: override defaults with your parameter-group value.
- Pods/instances count: number of application replicas.
- Pool size per pod: max DB connections one pod can open. For PHP apps, this often relates to PHP-FPM
pm.max_childrenand per-request DB usage. - Reserved connections: kept for admin/migrations/operational access.
- Safety headroom: percentage intentionally left unused for burst safety.
Example
pods = 25 pool size per pod = 40 total needed = 25 × 40 = 1000 usable connections = 600 status = DANGER Suggested fixes: - reduce pool size per pod - limit autoscaling upper bound - increase DB instance size / memory - for PostgreSQL, consider PgBouncer
More guides
Estimates only; validate against your DB parameter group and real workload.