
Reliability
Part of Managed databases in the cloud
Checking connection limits before an application launch
Calculate database connections across app instances and test pool waits, errors and query latency before launch.
Before launch, calculate the maximum number of database connections the whole application can open at once. Compare that demand with the chosen service’s usable connection limit, then test the expected peak. Include every application copy, background process and direct client that may run concurrently.
Build the connection budget
List web instances, background workers, scheduled jobs, reporting tools, migrations and operator sessions. For each process, record its maximum pool size and the greatest number of copies that may run, including overlap during deployment or autoscaling. Check whether the driver permits temporary overflow connections.
Calculate the ceiling as: required connection ceiling = sum of (maximum concurrent copies × maximum connections per copy) + direct clients + operational reserve. Compare this total with the service’s usable user-connection limit.
If six application copies can each open ten connections, their configured ceiling is 60 before jobs and reserve. This is illustrative arithmetic, not a recommended setting or measured demand.
Find the usable service limit
On Amazon RDS, check the max_connections setting for the selected engine and DB instance class. The stated default formula for MySQL is DBInstanceClassMemory / 12582880; for PostgreSQL it is LEAST(DBInstanceClassMemory / 9531392, 5000). A MySQL db.r6g.large example gives 683 connections.
Check the live value on the instance: MySQL uses SHOW GLOBAL VARIABLES LIKE 'max_connections';, and PostgreSQL uses SHOW max_connections;. The calculated default can differ slightly from the command output because Amazon RDS reserves memory for underlying operating system operations.
If using RDS Proxy, its database-side connection ceiling is set by MaxConnectionsPercent, as a percentage of the target database’s max_connections. For a database limit of 1,000 and a setting of 95%, that ceiling is 950 connections.
Azure Database for PostgreSQL flexible server publishes maximum connections and maximum user connections by pricing tier and vCores. It currently reserves 15 connections for physical replication and monitoring, though the reserved slots can change. Calculate available user connections as max_connections - (reserved_connections + superuser_reserved_connections) and verify the current reserve by summing those two parameters.
For example, Burstable B1ms (1 vCore) has 35 maximum user connections, B2s (2) has 414, and B2ms (2) has 844. General Purpose D2s_v3 (2 vCores) has 844 and D4s_v3 (4) has 1,703; Memory Optimized E2s_v3 (2 vCores) has 1,703 and E4s_v3 (4) has 3,422. Match the exact product name and vCore count, and use the maximum user connections figure.
Cloud SQL for PostgreSQL lists Managed Connection Pooling for Enterprise Plus, but not Enterprise. Include the selected edition’s pooling configuration in the launch test.
Treat a published maximum as a ceiling, not a normal operating target. Leave room for maintenance and operator access. Raising a connection setting does not create more memory or make slow queries finish faster.
Usable Connection Limits Across Cloud Database Services (Australia)
- Azure PostgreSQL B1ms (1 vCore)
- 35
- Azure PostgreSQL E2s_v3 (2 vCores)
- 1,703
- Cloud SQL for PostgreSQL (Enterprise Plus)
- Managed Pooling Enabled
Test the launch behaviour
In an isolated environment configured like the planned launch, increase application copies and request traffic towards the expected peak. Measure open and active connections, pool wait time, connection errors, database memory, query latency and completed user actions. Include expected deployment overlap and background-job bursts.
For RDS, use the DatabaseConnections CloudWatch metric over 1–2 weeks to identify peak connection usage. The stated buffer is to set max_connections about 10–20% above the observed peak.
If connections rise while queries stay fast, inspect pool sizes and idle connections. If requests wait for a local pool while the database has spare capacity, inspect pool sizing and how long the application holds connections. If queries slow as active work rises, increasing the pool may worsen contention.
Where a pooler is used, test its limits and behaviour under the expected peak as well as the database-side connection limit.
Key Connection Metrics to Monitor Before Launch
- Peak Database Connections (observed)
- Measured during test
- Connection Pool Wait Time
- Milliseconds
- Active Query Latency
- Milliseconds
- Completed User Actions per Second
- Count/sec
Record the launch decision
Keep the tested configuration, maximum observed connections, completed request rate, errors and the point where waits began. Agree on a threshold and response with the application and database owners. If pool size, workload concurrency or database capacity needs to change, repeat the relevant test before launch.
Pre-Launch Connection Validation Process
- Build connection budget across all app instances and processes
- Identify usable service limit based on DB instance and pricing tier
- Test in isolated environment under expected peak load
- Record observed metrics and set thresholds with stakeholders



