We Are Going To Discuss About HikariPool-1 – Connection is not available, request timed out after 30000ms for very tiny load server. So lets Start this Java Article.
HikariPool-1 – Connection is not available, request timed out after 30000ms for very tiny load server
- HikariPool-1 – Connection is not available, request timed out after 30000ms for very tiny load server
Your database is not obtaining connection within (30000 milliseconds that is default connectionTimeout property) because of network latency or some of the queries which are taking too long to execute(more than 30000 milliseconds).
- HikariPool-1 – Connection is not available, request timed out after 30000ms for very tiny load server
Your database is not obtaining connection within (30000 milliseconds that is default connectionTimeout property) because of network latency or some of the queries which are taking too long to execute(more than 30000 milliseconds).
Solution 1
Your database is not obtaining connection within (30000 milliseconds that is default connectionTimeout property) because of network latency or some of the queries which are taking too long to execute(more than 30000 milliseconds).
Please try to increase value of property connectionTimeout
.
YML configuration example:
spring:
datasource:
hikari:
minimumIdle: 2
maximumPoolSize: 10
idleTimeout: 120000
connectionTimeout: 300000
leakDetectionThreshold: 300000
Java Config example:
HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(20);
config.setConnectionTimeout(300000);
config.setConnectionTimeout(120000);
config.setLeakDetectionThreshold(300000);
Original Author Girdhar Singh Rathore Of This Content
Solution 2
I am using spring boot and I was facing the same problem, and my solution was to get the connection like this “DataSourceUtils.getConnection(dataSource)
“. So I change from dataSource.getConnection()
to DataSourceUtils.getConnection(dataSource)
.
Original Author Andres Rincon Of This Content
Solution 3
In my case the code wasn’t closing the connections.
Try-with-resources fixed it:
try (
Connection connection = dataSource.getConnection();
Statement statement = …
) {
…
}
Original Author Vlad L Of This Content
Solution 4
request timeout is not something that you can fix by increasing the timeout. Perhaps you’d need to evaluate all the queries from your service and implement indexing if it’s needed
Original Author Gregory Laksono Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.