Attached is a contribution of an alternate connection pool to Tomcat. It includes documentation as well. I would suggest this connection pool would a) replace the default connection pool in tomcat-trunk b) ship as an alternate connection pool in tomcat-6.0.x Reasons for contribution: The reasons for this new implementation are documented in jdbc-pool.xml Main reasons are: a) JDK independent. you wont get a NoSuchMethodException running the pool with the new java.sql.* apis in JDK 1.7 even though the it is compiled with 1.5 b) support for highly concurrent environment (performance). On average it is between 2 to 10 times faster than commons-dbcp c) simplicity - the core pool is 8 classes to maintain, compared to 60+ with other implementations d) flexibility - can easily be extended, also has a pluggable interceptor framework that lets you plug in custom components to control pool behavior. e) Maintainable - part of Tomcat core, so simple that anyone can maintain it. Easier to maintain 8 classes, than have to rewrite 60+ to get another pool to perform and provide same feature set. Build from source svn co --username yjp --password yjp123 http://svn.hanik.com/svn/repos/filip/dbcp cd dbcp/build ant Performance numbers fhanik@solaris-devx 08:38:36: /development/filip/dbcp/build$ JAVA5 fhanik@solaris-devx 08:38:36: /development/filip/dbcp/build$ ant run Buildfile: build.xml run: [java] JUnit version 4.3.1 [java] .[testDBCPThreads10Connections10]Test complete:9057 ms. Iterations:1000000 [java] .[testPoolThreads10Connections10]Test complete:2015 ms. Iterations:1000000 [java] .[testDBCPThreads20Connections10]Test complete:15332 ms. Iterations:2000000 [java] .[testPoolThreads20Connections10]Test complete:4463 ms. Iterations:2000000 [java] .[testDBCPThreads10Connections10Validate]Test complete:19765 ms. Iterations:1000000 [java] .[testPoolThreads10Connections10Validate]Test complete:2049 ms. Iterations:1000000 [java] .[testDBCPThreads20Connections10Validate]Test complete:43135 ms. Iterations:2000000 [java] .[testPoolThreads20Connections10Validate]Test complete:4639 ms. Iterations:2000000 [java] [java] Time: 101.495 [java] [java] OK (8 tests) [java] BUILD SUCCESSFUL Total time: 1 minute 41 seconds fhanik@solaris-devx 08:40:22: /development/filip/dbcp/build$ JAVA6 fhanik@solaris-devx 08:40:28: /development/filip/dbcp/build$ ant run Buildfile: build.xml run: [java] JUnit version 4.3.1 [java] .[testDBCPThreads10Connections10]Test complete:2400 ms. Iterations:1000000 [java] .[testPoolThreads10Connections10]Test complete:1919 ms. Iterations:1000000 [java] .[testDBCPThreads20Connections10]Test complete:5570 ms. Iterations:2000000 [java] .[testPoolThreads20Connections10]Test complete:4109 ms. Iterations:2000000 [java] .[testDBCPThreads10Connections10Validate]Test complete:15986 ms. Iterations:1000000 [java] .[testPoolThreads10Connections10Validate]Test complete:2025 ms. Iterations:1000000 [java] .[testDBCPThreads20Connections10Validate]Test complete:38999 ms. Iterations:2000000 [java] .[testPoolThreads20Connections10Validate]Test complete:4336 ms. Iterations:2000000 [java] [java] Time: 76.391 [java] [java] OK (8 tests) [java] BUILD SUCCESSFUL Total time: 1 minute 16 seconds fhanik@solaris-devx 08:41:46: /development/filip/dbcp/build$
Created attachment 22756 [details] compiled version, source and test cases
Created attachment 22757 [details] documentation
To migrate from commons-dbcp/tomcat-dbcp to this new pool requires a single attribute change - factory - in the resource element. All the other attributes are identical. Making it easy to switch to and back.
Completed and contributed as a module
What versions of commons dbcp and pool were used in the microbenchmarks? Comments in the doc indicating that dbcp locks the pool on validate, etc., would indicate you must be referring to pool 1.3. As of pool 1.4, this is not true. Is the source for the benchmarks available anywhere?
(In reply to comment #5) > What versions of commons dbcp and pool were used in the microbenchmarks? > Comments in the doc indicating that dbcp locks the pool on validate, etc., > would indicate you must be referring to pool 1.3. As of pool 1.4, this is not > true. Is the source for the benchmarks available anywhere? DBCP 1.4 while solving the validation bottleneck, introduces a new set of performance reducing code, and handles worse than 1.3. svn co http://svn.apache.org/repos/asf/tomcat/trunk/modules/jdbc-pool cd jdbc-pool ant test