13

Our site get roughly 1M pv/day, and we use Tomcat for sure.

I couldn't find much information about jdbc-pool, not sure if it's stable enough for production. Anyone got experience on it? and any configuration/tuning stuff for reference?

As someone mentioned, BoneCP might be another choice. 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.

Thanks for any advice.

BigFatSea
  • 473
  • 1
  • 6
  • 13

5 Answers5

28

I'm one of the authors of HikariCP. That said, the "new" Tomcat pool is among the best we've tested. 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.

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. Check out site for results in the coming weeks.

EDIT: Re: HikariCP being too young. 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. The refactors in Commons DBCP appear at first glance to be significant, and positive. 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.

brettw
  • 10,664
  • 2
  • 42
  • 59
  • 2
    I must say "GOOD JOB" to the HikariCP team, and I'll try it in some of my projects. But for production choice, maybe I should go with jdbc-pool. Any experience/links would be appreciated. – BigFatSea Jan 07 '14 at 12:35
  • @brettw Although it's a little bit off-topic: Are you an author of HikariCP since its beginning or have you joined later after you did comprehensive tests/analysis of it? – MRalwasser Oct 22 '14 at 14:40
  • 1
    @brettw I just started with spring boot application and it has built in tomcat JDBC-Pool. Then I started to search which pool is best, I could not find satisfying answer. Then I came to your answer which is 2 years old . Can you please update the answer and put an edit note to specify the best connection pool for server application under medium to heavy load with good concurrency support. – Mubasher Feb 16 '17 at 10:49
9

BoneCP is not discontinued, but consider it @Deprecated now that HikariCP is around; 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)

wwadge
  • 3,506
  • 1
  • 19
  • 28
  • 12
    Hey now, don't sell BoneCP short. It has features that HikariCP will likely never have, such as connection lifecycle hooks. If a user needs those features, BoneCP is still a clear choice. Source: one of the authors of HikariCP. – brettw Jan 15 '14 at 01:08
3

Tomcat DBCP is production ready - its simply an evolution of commons DBCP.

DB conn pools are pretty simple beasts - I wouldnt regard its use as being particularly risky.

pauljwilliams
  • 19,079
  • 3
  • 51
  • 79
  • Thanks for clarify it, would appreciate if any configuration guide/best practice provided. – BigFatSea Jan 07 '14 at 12:36
  • Config can be pretty much copied from commons-dbcp. The reference guide is pretty clear. – pauljwilliams Jan 07 '14 at 15:06
  • 4
    I would not call conn pools simple. There has been a history of serious problems with various pools because of issues both gross and subtle. Issues like thread-safety, testing validity of conn, resolving pending txns, ease of configuration. – Basil Bourque Aug 23 '14 at 14:52
3

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. 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.

RyNo
  • 203
  • 2
  • 4
  • as mentioned by @brettw, jdbc-pool might be complicated for newbie, could you please share some of your experience (or some links) about it? – BigFatSea Jan 07 '14 at 12:30
3

Where I work we have a couple of systems running on the Tomcat pool.

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. 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

ha9u63a7
  • 6,233
  • 16
  • 73
  • 108
geoand
  • 60,071
  • 24
  • 172
  • 190