- Newest
- Most votes
- Most comments
Possible Reasons for Higher Query Times
1. Proxy Overhead: RDS Proxy introduces some overhead due to connection pooling and managing connections between your application and the database. This overhead can result in slightly higher query times compared to direct connections.
2. Connection Pooling Configuration: If the connection pool settings are not optimized, it can lead to inefficient connection handling, increasing query latency. Ensure the pool settings are tuned for your workload.
3. Warm-up Time: RDS Proxy may need time to warm up, especially under high concurrency. Initial connections might take longer as the proxy sets up its internal state.
4. Proxy Caching: Check if the proxy is correctly caching prepared statements and handling frequent queries efficiently. Misconfigured caching might lead to higher query times.
Possible Reasons for Higher Connection Times
1. TLS Overhead: You mentioned that TLS is disabled, so this should not be a factor. However, double-check to ensure that TLS is indeed disabled in all parts of your configuration.
2. Connection Pooling Behavior: RDS Proxy might be opening new connections to the database instead of reusing existing ones. Ensure your application is reusing connections efficiently.
3. Proxy Scaling: If the proxy has to scale up to handle a sudden influx of connections, this can introduce latency. Ensure your proxy is appropriately scaled for your workload.
Recommendations for Optimization
1. Optimize Connection Pool Settings: Tune the minimum and maximum connections, idle connection timeout, and other pool settings to match your application's workload.
2. Reuse Connections: Reusing database connections in your application code can significantly reduce connection overhead. Using a connection pool within your application, in addition to RDS Proxy, can help.
3. Monitor and Analyze Metrics: Use Amazon CloudWatch to monitor RDS Proxy metrics. Look for metrics such as DatabaseConnections, ClientConnections, ActiveClientConnections, ActiveDatabaseConnections, and MaxConnectionsLimitReached.
4. Review Application Code: Ensure your application is not frequently opening and closing connections. Use connection pools in your application to maintain persistent connections.
Hi there, thanks for your response. I have few follow up questions.
- Connection Pooling Configuration: What configuration would need to be controlled for making query response faster?
- Proxy Caching: We don't have any prepared statement and in this case, the test is for a simple query which shouldn't need any caching. Could you please explain more on this and does RDS proxy have a control for this?
- Proxy Scaling: How do we make sure of RDS proxy is ready for scale? It's a managed service and looks like we don't have much control over it.
Thanks for your time.
Relevant content
- asked 6 months ago
- asked 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago
please accept the answer if it was useful
Just wanted to say we ran similar tests and experienced similar results.
Hi jrobe, thanks for confirming. I also see few other threads having same issue. It will be great to know if this has been resolved.