监视Commons DBCP? [英] Monitoring for Commons DBCP?

查看:95
本文介绍了监视Commons DBCP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Tomcat中的一个庞大的Web应用程序有时开始使用太多的DBCP连接,从而导致问题.
为了进行调查,我想在每个时间点精确地知道哪个线程/方法正在保持池的连接.不需要实时,事后分析就可以了.

A huge webapp in my Tomcat sometimes starts using too many DBCP connections, leading to problems.
To investigate, I want to know precisely at each point in time what thread/method is holding a connection of the pool. Does not need to be real-time, post-mortem analysis is OK.

我一直在寻找这种DBCP监视工具是徒劳的,所以我要写我的文章.
(如果有兴趣,我可以将其开源)

I have been looking for such a DBCP monitoring tool, in vain, so I am about to write mine.
(if there is any interest I can make it open source)

这是我的计划:

  • Modify PoolingDataSource.getConnection to log "DBCP+1 <thread-id>"
  • Modify DelegatingConnection.close to log "DBCP-1 <thread-id>"
  • Write a small script to generate this simple CSV for visualization:

问题:
我是否缺少一些使该想法无效的Commons-DBCP 1.4概念?
还是我在重新发明轮子?

QUESTION:
Am I missing some Commons-DBCP 1.4 concept that makes the idea invalid?
Or am I re-inventing the wheel?

推荐答案

没有这样的工具,所以我创建了它:

There was no such tool, so I created it:

https://github.com/nicolas-raoul/Commons-DBCP-monitoring

它监视Commons DBCP的使用情况(使用/等待连接),并允许创建这样的图形:

It monitors Commons DBCP usage (using/waiting for connection) and allows one to create such graphs:

我的假设在Commons DBCP邮件列表中是否有效.

I asked whether my assumptions are valid on the Commons DBCP mailing list.

这篇关于监视Commons DBCP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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