Select Language:
If you’re noticing high DatabaseConnectionsBorrowLatency with RDS Proxy even when your database isn’t under heavy load, there are a few common reasons and simple ways to fix them.
First, this latency measures how long it takes for RDS Proxy to get a database connection from the pool. A long delay (more than 5 seconds) usually means the proxy is having trouble providing connections quickly, even if there aren’t many connections happening at once.
One common cause is reaching the maximum number of connections allowed. Your database has a limit set by the MaxConnections parameter, and RDS Proxy adjusts its maximum connections based on the MaxConnectionsPercent setting. Check the connection metrics to see if you’re nearing this limit. If so, you might need to increase the limit or optimize your application’s connection usage.
Another factor could be the ConnectionBorrowTimeout setting. This setting controls how long RDS Proxy waits for a connection before giving up. If it’s set too high, it causes unnecessary waiting. Lowering this value may help reduce delays for your application.
Connection pinning can also cause issues. This happens when your application keeps a connection tied to a specific session, so RDS Proxy can’t reuse connections efficiently. Activities like temporary table usage, certain commands, or multi-statement transactions can cause pinning. Review your code to minimize these patterns and improve connection reuse.
Even if the database load seems low, the database might be temporarily slow or unavailable, which can cause connection delays. Check if your database instance is performing well and is accessible at all times.
Make sure your proxy target group is properly configured, and the database is healthy. Use the AvailabilityPercentage metric in CloudWatch to verify the database’s availability.
To troubleshoot, start by reviewing your ConnectionBorrowTimeout and MaxConnectionsPercent settings. Then, check for connection pinning in your application code. Monitor the DatabaseConnections and MaxDatabaseConnectionsAllowed metrics, and examine database availability metrics.
If you’ve done all this and the problem persists, reaching out to AWS Support can provide more detailed help to resolve the issue.





