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
idleTimeout property not working as expected #683
Comments
@ehtashamulhaq Try setting maxLifetime to 15 seconds less than 'device time out' (885000) |
Also, please specify (approx) duration for 'very long delay in getConnection() method' |
aprox 190-200 sec delay. Here is the logs snippet. 16 Jul 2016;03:29:08.078http-nio-80-exec-17WARNcom.zaxxer.hikari.pool.PoolBaseHikariPool-0 - Connection oracle.jdbc.driver.T4CConnection@30085296 failed alive test with exception IO Error: Socket read timed out |
If you can turn log level to debug, its not chatty, will give more insight |
19 Jul 2016;09:20:46.729http-nio-80-exec-6DEBUGcom.zaxxer.hikari.pool.PoolBaseHikariPool-0 - Reset (nothing) on connection oracle.jdbc.driver.T4CConnection@7f66acb |
Here is another logs snippet from some previous logs with debug level. I would not able to provide the latest because we fixed this issue by removing the code mentioned above and now its working fine. |
The issue is the idleTimeout occur on our networking device and close the connection but the Hikari not close the connection with specified idleTimeout. The setting maxLifetime to 15 seconds less than 'device time out' wil also solve the problem but it will make negative performance impact when there is much load on application. It will un-necessary close valid connections and recreate them during peak work hours. |
It seems log is not from HikariCP 2.4.7 Do you set maxLifetime = 0 ? |
@ehtashamulhaq First, this behavior was changed for #379. Second, setting the When you configure a maxLifetime of 15 minutes that is not a "hard limit". HikariCP injects a 2.5% variation into individual connection maximum lifespans. With a lifespan of 15 minutes this amounts to 22.5 seconds variation. So, some connections might retire at 14m38s, others at 14m53s, etc. After several "generations" the random variation causes the lifespan distribution to spread evenly (statistically) across the 15 minute interval, so that on average 1 connection is retired and replaced every 90s (in the background). Again, if you can measure a negative impact that is above statistical noise, we would be interested in seeing those measurements. |
We have following configuration for HikariCP 2.4.7 in our application. ["maximumPoolSize: 30", "minimumIdle: 10" and "idleTimeout: 600000"] The smart network device between our database and application sever have setting TCP idle timeout 15 minutes (900000ms). When our app stays idle (with nobody making requests) during the night, I expect Hikari to close each connection after 10 minutes (+30 sec) after the connection's last request, after the last connection being closed create a new one (and hold it in the pool), and then close and re-create this idle connection every 10 minutes.
The fact is that after an idle period on my app, I see (uppon the next request) the following exception and very long delay in getConnection() method:
WARNcom.zaxxer.hikari.pool.PoolBaseHikariPool-0 - Connection oracle.jdbc.driver.T4CConnection@5345e00c failed alive test with exception IO Error: Socket read timed out.
Removing following lines from the HikariPool class fixed the issue.
Kindly fix this issue either this way or provide some additional configuration property to refresh the minimum idle connections on idleTimeout.
The text was updated successfully, but these errors were encountered: