Hi all,
I'm using Hikari 2.4.12 (java 7) version with the following configuration in Hibernate (5.1.2) and Spring (4.3.3):
Code:
<bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig">
<property name="poolName" value="springHikariCP" />
<property name="connectionTestQuery" value="${database.connectionTestStatement}" />
<property name="jdbcUrl" value="${database.jdbc.url}" />
<property name="connectionTimeout" value="15000"/>
<property name="maximumPoolSize" value="${database.poolConnections:40}" />
<property name="maxLifetime" value="27000000"/>
<property name="dataSourceProperties">
<props>
<prop key="url">${database.jdbc.url}</prop>
<prop key="user">${database.user}</prop>
<prop key="password">${database.password}</prop>
<prop key="cachePrepStmts">true</prop>
<prop key="prepStmtCacheSize">250</prop>
<prop key="prepStmtCacheSqlLimit">2048</prop>
</props>
</property>
We have seen that the number of connections is being reduced in time and after a week more or less we get connection exceptions:
QueryTimeoutException: Unable to acquire JDBC Connection.....
That's to say, there are no available connections in the pool.
I attach a plot of the behaviour of the connections (the recover corresponds to backend deployments so the connections are recovered) :
[img]
https://ibb.co/jm7goa[/img]
https://ibb.co/jm7goaIt seems that after the maxLifeTime the connections can not be reestablished in the pool. The database (mysql) wait_timeout is 28800 seconds, so the pool maxLifeTime is less as recommended.
We do not use miminumIdle in favour of better performance and responsiveness as says the Hikari Cp documentation.
Is there a better/correct configuration to avoid the loose of connections?.
Best regards.