简体   繁体   English

“ Tomcat 7 JDBC连接池”是否足以用于生产? 与BoneCP相比如何?

[英]Is “Tomcat 7 JDBC Connection Pool” good enough for production? And how is it compare to BoneCP?

Our site get roughly 1M pv/day, and we use Tomcat for sure. 我们的网站每天获得大约1M光伏,并且可以肯定地使用Tomcat。

I couldn't find much information about jdbc-pool , not sure if it's stable enough for production. 我找不到有关jdbc-pool的太多信息,不确定它是否足够稳定以进行生产。 Anyone got experience on it? 任何人都有经验吗? and any configuration/tuning stuff for reference? 以及任何配置/调优资料以供参考?

As someone mentioned, BoneCP might be another choice. 就像有人提到的那样, BoneCP可能是另一种选择。 But seems it's discontinued (so sad...). 但似乎已经停产了(真可悲...)。 Would it be a better choice? 会是更好的选择吗?

btw, HikariCP is too young, I would keep an eye on it as it's the latest/fastest CP so far I found. 顺便说一句, HikariCP还太年轻,我会一直关注它,因为它是我发现的最新/最快的CP。

Thanks for any advice. 感谢您的任何建议。

I'm one of the authors of HikariCP. 我是HikariCP的作者之一。 That said, the "new" Tomcat pool is among the best we've tested. 也就是说,“新” Tomcat池是我们测试过的最好的池之一。 It has a lot of options, so if you plan to use it in production make sure you understand them to get a reliable configuration. 它有很多选择,因此,如果您打算在生产中使用它,请确保您了解它们以获取可靠的配置。

Do not confuse the new Tomcat pool with Apache DBCP, which I would avoid. 不要将新的Tomcat池与Apache DBCP混淆,我会避免这种情况。

We are starting the process of abuse testing various pools, including HikariCP, with tests such as bouncing the DB underneath the pool and measuring the resulting recovery. 我们正在开始滥用测试过程,包括对包括HikariCP在内的各种池进行测试,例如将池下的DB弹起并测量所产生的恢复。 Check out site for results in the coming weeks. 在未来几周内查看网站以获取结果。

EDIT: Re: HikariCP being too young. 编辑:回复:HikariCP太年轻。 Young though it may be it has had several billion transactions run through it. 尽管可能还很年轻,但它已经进行了数十亿笔交易。 As with anything, I would suggest you try it in a pre-production environment before deployment. 像其他任何事情一样,我建议您在部署之前在预生产环境中进行尝试。 But the same goes for any pool you might choose. 但是对于您可能选择的任何池也是如此。

UPDATE 2015-06-01: I want to revise my statement above somewhat, it seems that Apache Commons DBCP is active once again, and has taken over for the dedicated/forked Tomcat DBCP. UPDATE 2015-06-01:我想稍微修改一下我的声明,看来Apache Commons DBCP再次处于活动状态,并且已经接管了专用/分叉的Tomcat DBCP。 The refactors in Commons DBCP appear at first glance to be significant, and positive. 乍看之下,Commons DBCP中的重构是重要且积极的。 However, due to their magnitude and despite being under the old Commons DBCP banner, I would characterize the pool as less mature than HikariCP at this point. 但是,由于它们的规模,并且尽管处于Commons DBCP的旧旗帜下,但在这一点上,我认为该池不如HikariCP成熟。

BoneCP is not discontinued, but consider it @Deprecated now that HikariCP is around; BoneCP并没有停产,但是考虑到HikariCP已经存在,建议不要使用它。 there's little point contributing significant resources to it now that something radically better is on the horizon. 既然即将出现更好的事情,那么为此投入大量资源几乎没有意义。 This is open-source, so let's all work collectively towards the best solution. 这是开源的,因此让我们共同努力以寻求最佳解决方案。 Source: me (BoneCP author) 资料来源:我(BoneCP作者)

Tomcat DBCP is production ready - its simply an evolution of commons DBCP. Tomcat DBCP已准备好投入生产-它只是Common DBCP的演变。

DB conn pools are pretty simple beasts - I wouldnt regard its use as being particularly risky. DB conn池是非常简单的野兽-我不会认为使用它特别危险。

That's what the company I'm working for is using and we haven't had any problem with it. 这就是我正在工作的公司所使用的,我们对此没有任何问题。

We've been more limited by our web server's connection to our various data servers than the speed of Tomcat's connection pool, so unless speed is very important, it's probably not something you should be concerned about. Web服务器与各种数据服务器的连接比Tomcat的连接池的速度受到更多的限制,因此,除非速度非常重要,否则您不必担心。 As far as reliability goes, it hasn't dropped a connection yet in any of our testing, nor have we heard about it happening on our production site. 就可靠性而言,在我们的任何测试中都尚未断开连接,也没有听说过在生产现场发生这种情况。

I doubt you'll have a problem if you use Tomcat's connection pool. 我怀疑如果使用Tomcat的连接池会遇到问题。

Where I work we have a couple of systems running on the Tomcat pool. 在我工作的地方,有两个在Tomcat池上运行的系统。

I must say that initially it was sort of a pain to get a good understanding of all the options it provides and how their values actually impact performance and reliability. 我必须说,一开始要很好地理解它提供的所有选项以及它们的值实际上如何影响性能和可靠性是一种痛苦。

After performing an initial trial and error phase, I have to admit that the Tomcat connection pool fits our needs perfectly. 在执行了最初的试验和错误阶段之后,我不得不承认Tomcat连接池完全符合我们的需求。 It seems robust and also have not caused any performance problems whatsoever. 看起来很健壮,也没有引起任何性能问题。

With that said, I will definitely give HikariCP a try in my next project 话虽如此,我肯定会在下一个项目中尝试HikariCP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM