Based on your configuration and symptoms, here’s a comprehensive solution addressing all three focus areas:
Root Cause:
The ac-2020 database module introduced significant changes to connection lifecycle management that affect max_connections, connection pooling behavior, and CloudMonitor integration.
1. Max_Connections Management (AC-2020 Changes):
Ac-2020 now includes system connections in the max_connections count:
- RDS monitoring: ~20 connections
- Backup processes: ~15 connections
- CloudMonitor agents: ~10 connections
- Your effective application limit: ~955 connections (not 1000)
With 5 microservices × 100 max connections = 500 theoretical max, but connection leaks or slow queries can push this higher. Increase max_connections:
max_connections = 1500
max_user_connections = 1200
2. Connection Pooling Optimization:
Ac-2020’s new validation layer requires application-side adjustments:
Application Pool Settings (for each microservice):
- testOnBorrow = true (critical for ac-2020)
- validationQuery = “SELECT 1”
- validationTimeout = 3000ms
- timeBetweenEvictionRunsMillis = 30000
- minEvictableIdleTimeMillis = 180000 (reduced from 600000)
- maxWait = 10000ms
RDS Parameters to Adjust:
wait_timeout = 7200
interactive_timeout = 7200
connection_control_failed_connections_threshold = 10
max_connect_errors = 100
The key change: align your wait_timeout with ac-2020’s default (7200s) rather than fighting it with 28800s. The module’s connection validator expects this value.
3. CloudMonitor Integration:
Ac-2020 added enhanced connection monitoring. Set up these alerts:
- ConnectionPoolUtilization > 85%
- ConnectionPoolWaitTime > 100ms
- ActiveConnections approaching max_user_connections
- AbortedConnections rate > 10/minute
Access these via CloudMonitor → RDS → Instance Metrics → Connection Pool (new in ac-2020).
Additional AC-2020 Specific Settings:
performance_schema = ON
max_prepared_stmt_count = 32768
The performance_schema integration with ac-2020 helps identify connection leaks in real-time.
Implementation Order:
- Update RDS parameters (requires reboot during maintenance window)
- Deploy application pool configuration changes
- Configure CloudMonitor alerts
- Monitor for 48 hours
- Adjust max_connections if needed
Verification:
After implementing these changes, your connection pool exhaustion should resolve. The “Aborted connection” warnings will decrease by 90%+. The spike to 950+ connections was caused by the validation layer marking connections as stale while your application pool still counted them as active - this mismatch is now eliminated.
Monitor CloudMonitor’s new ConnectionPoolUtilization metric - it should stabilize under 70% during peak hours with these settings.