Too many connection Error in Spring Boot/MySQL

2,478 views
Skip to first unread message

asaraff

unread,
Mar 10, 2015, 2:12:47 PM3/10/15
to hika...@googlegroups.com
When trying to change the connection pool from BoneCP to HikariCP, we noticed the the boot-application failing because of:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections

We used the recommended settings in Wiki for Boot (use JDBC URL and pool size of 'default').

The application is deployed on AMZN RDS Mysql. The BoneCP is working fine. Any ideas?

Versions: 

Java 8

Spring 4.1.x/Boot 1.2.x

Mysql Driver version: 5.1.34

Jens

unread,
Mar 10, 2015, 3:16:38 PM3/10/15
to hika...@googlegroups.com
Most likely your HikariCP configuration does not yet match your previous BoneCP configuration and your app creates more connections to the MySQL server on startup than allowed by the server.

One noticeable difference is that HikariCP, by default, creates as many connections as defined by the maximum pool size as soon as the HikariCP pool starts while BoneCP might create less connections on startup and then adds connections as needed up to the maximum pool size.

If you want the same behavior with HikariCP then you have to configure HikariCP's minimumIdle property. By default it has the same value as maximumPoolSize.

-- J.
Reply all
Reply to author
Forward
0 new messages