HikariCP调试输出,这是正常的吗? [英] HikariCP debug output, is this normal?

查看:1385
本文介绍了HikariCP调试输出,这是正常的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用HikariCP在具有休眠功能的swing应用程序中使用。我正在维护和旧项目,所以有很多疯狂的东西在那里。连接泄漏检测功能帮助我了解会话只会在某些事件中关闭,例如,当用户点击保存按钮时。在其他情况下,有泄漏。我认为以前的开发人员试图实现长谈话工作单元,但他们错过了一些(大多数)情况。

所以我现在的目标是找到所有泄漏并修复它们。我打算使用HikariCP调试输出来帮助我做到这一点。我不知道在HikariCP文档中是否有一个解释调试输出的维基页面,但我想知道应用程序闲置时的输出是否正常,或者有什么奇怪的事情发生,我应该调查更多:

  2015-09-14 01:12:51 DEBUG HikariPool  - 填充池统计信息HikariPool-0(总数= 10, inUse = 3,avail = 7,waiting = 0)
2015-09-14 01:13:21 DEBUG HikariPool - 清理池统计之前HikariPool-0(总数= 10,inUse = 3,avail = 7,等待= 0)
2015-09-14 01:13:21 DEBUG HikariPool - 清理池统计后HikariPool-0(总数= 6,inUse = 3,avail = 3,等待= 0)
2015- 09-14 01:13:21 DEBUG PoolUtilities - 关闭连接com.mysql.jdbc.JDBC4Connection@4fb38272
2015-09-14 01:13:21 DEBUG PoolUtilities - 关闭连接com.mysql.jdbc.JDBC4Connection@417465f4
2015-09-14 01:13:21 DEBUG PoolUtilities - 关闭连接com.mysql.jdbc.JDBC4Connection@454be902
2015-09-14 01:13:21 DEBUG PoolUt ilities - 关闭连接com.mysql.jdbc.JDBC4Connection@496fcf

如果这是正常行为,我会也想知道这4个连接是为了什么,为什么他们在那个时候关闭。谢谢。

解决方案

这是所有正常输出。这些连接可能由于闲置idleTimeout时段而关闭,或者因为它们达到其生命周期(maxLifetime)。我建议更新到最新版本(2.4.x),这通常会提供连接在调试日志消息中关闭的原因。


I've just started using HikariCP in a swing application with hibernate. I'm maintaining and old project, so there are a lot of crazy stuff going on in there. The connection leak detection feature helped me understand the sessions would close only on certain events, for example when a user is clicking on the "Save" button. In other cases, there is a leak. I'm thinking the previous developers were trying to implement the "long conversations" unit of work, but they missed some (most) cases.

So my goal now is to find all leaks and fix them. I'm planning to use the HikariCP debug output to help me do that. I don't know if there is a wiki page on the HikariCP documentation that explains the output of debugging, but I was wondering if this output when the application is idle is normal, or there is something strange going in there that I should investigate more:

2015-09-14 01:12:51 DEBUG HikariPool - After fill pool stats HikariPool-0 (total=10, inUse=3, avail=7, waiting=0)
2015-09-14 01:13:21 DEBUG HikariPool - Before cleanup pool stats HikariPool-0 (total=10, inUse=3, avail=7, waiting=0)
2015-09-14 01:13:21 DEBUG HikariPool - After cleanup pool stats HikariPool-0 (total=6, inUse=3, avail=3, waiting=0)
2015-09-14 01:13:21 DEBUG PoolUtilities - Closing connection com.mysql.jdbc.JDBC4Connection@4fb38272
2015-09-14 01:13:21 DEBUG PoolUtilities - Closing connection com.mysql.jdbc.JDBC4Connection@417465f4
2015-09-14 01:13:21 DEBUG PoolUtilities - Closing connection com.mysql.jdbc.JDBC4Connection@454be902
2015-09-14 01:13:21 DEBUG PoolUtilities - Closing connection com.mysql.jdbc.JDBC4Connection@496fcf

If this is normal behaviour, I would also like to know what these 4 connections are for, and why are they closing at that point. Thanks.

解决方案

This is all normal output. These connections are likely closing due to being idle for the "idleTimeout" period, or because they reached their lifetime ("maxLifetime"). I do recommend updating to the latest version (2.4.x), which will typically provide a reason why the connection was closed in the debug log message.

这篇关于HikariCP调试输出,这是正常的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆