-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The connection pool size decreases from 20 (maximum pool size) to zero [Azure SQL Managed Instance] #2239
Comments
I think you should set |
Hi @quaff, I have already set the |
Great article on this issue: https://medium.com/@eremeykin/how-to-deal-with-hikaricp-connection-leaks-part-1-1eddc135b464 I am unsure if this solves your issue, but it may help you debug the issue and find which code is causing the problem. |
Hi @nitin-vavdiya, thank you for your feedback, we have checked the scenarios described in the link you shared and we aren't in any of them. As from the initial statement, our scenario is very similar to the one reported in many other linked, e.g. |
Hi, we are taking decision to move away from Hikari in favor of Tomcat connection pool, however I just found this article |
Socket-level timeout and TCP keepalive are essential for reliability. Regardless of pool. See the new “Important” note added at the top of the main repo page. So far in all of the reports of this issue that have included stacktrace analysis, all have pointed to TCP layer issues and none have indicated any failure in the pool itself. Additionally, running the latest version of the pool is always recommended. |
Hi
we are experiencing issues similar to #1474 where the total connections gradually decrease from the maximum pool size, 20, down to zero, see evidence from the debug log info:
When the total connections reach 0, all requests to the connection pool fail due to connection not available and the following exception is thrown:
Here's the details for our application:
We reached Microsoft support, who confirmed that Azure SQL Managed Instance (SQL MI) utilizes an idle connection timeout mechanism, where connections that remain idle for approximately 30 minutes are automatically closed. This behavior is managed by the SQL MI proxy layer to free up resources and maintain optimal performance. To prevent connections from timing out, they recommend to implement a keep-alive mechanism or send periodic queries to keep the connection active.
However, they suggested opening a ticket on GitHub to HikariCP since they don’t have enough expertise or a dedicated team to provide specific settings.
Can you advice on what to do to resolve?
MaxLifetime: Setting this to 15 minutes (or 900,000 milliseconds) ensures that the lifetime of connections in the pool is shorter than the database or infrastructure-imposed connection timeout, such as the 30-minute idle timeout for Azure SQL Managed Instance. This helps avoid situations where the database closes idle connections unexpectedly.
KeepaliveTime: Setting this to 5 minutes (or 300,000 milliseconds) is a good approach to ensure that HikariCP sends periodic keep-alive queries. This should be less than the maxLifetime to avoid conflicts and ensure idle connections stay active.
The text was updated successfully, but these errors were encountered: