-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
Current setup
- Application: Spring Boot 3.3.0
- Java: 21
- Connection Pool: HikariCP 5.1.0
- Database: Aurora MySQL 8
- RDS Proxy: Enabled (with default pool settings)
Steps to reproduce
- Configure Spring Boot application with HikariCP pointing to Aurora MySQL through AWS RDS Proxy.
- Run application under normal traffic.
- Observe connection count at the database level.
- Before enabling RDS Proxy (normal traffic): ~18–20 connections
- After enabling RDS Proxy (same traffic): ~60–65 connections (close to the per-user max of 65 in RDS)
Connections continue to grow (2x–3x higher than before proxy), even when traffic remains stable.
Expected behavior
HikariCP should reuse connections efficiently through RDS Proxy without exceeding configured pool limits.
Actual behavior
- Connections are not being reused as expected.
- Over time, HikariCP hits the max connection limits, leading to errors such as:
Too many connectionsMax connections reached
- Observed that connections accumulate on the RDS side and are not released properly.
Error messages / Logs
Examples (seen intermittently under load):
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failureToo many connections
HikariCP Configs
datasource.url=jdbc:mysql://${DB_HOST}:${DB_PORT}/${DB}?useUnicode=yes&characterEncoding=UTF-8&charSet=UTF-8&useSSL=false&tcpKeepAlive=true&cachePrepStmts=false
datasource.connection-timeout=30000
datasource.idle-timeout=1200000 # 20 mins
datasource.max-lifetime=1740000 # 29 mins
datasource.maximum-pool-size=5
datasource.minimum-idle=3
datasource.leak-detection-threshold=15000Metadata
Metadata
Assignees
Labels
No labels