Jdbc HikariCP:从BoneCP迁移并分析基准数据

Jdbc HikariCP:从BoneCP迁移并分析基准数据,jdbc,benchmarking,connection-pooling,vmware,hikaricp,Jdbc,Benchmarking,Connection Pooling,Vmware,Hikaricp,我正在测试从BoneCP到HikariCP的迁移 基准测试()的结果如下: Benchmark (maxPoolSize) (pool) Mode Samples Score Score error Units c.z.h.b.ConnectionBench.cycleCnnection 32 hikari thrpt 16 1033,071 38,

我正在测试从BoneCP到HikariCP的迁移

基准测试()的结果如下:

Benchmark (maxPoolSize) (pool) Mode Samples Score Score error Units c.z.h.b.ConnectionBench.cycleCnnection 32 hikari thrpt 16 1033,071 38,893 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 bone thrpt 16 1648,954 42,610 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 tomcat thrpt 16 592,838 21,709 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 c3p0 thrpt 16 125,857 3,666 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 vibur thrpt 16 831,693 9,299 ops/ms c.z.h.b.StatementBench.cycleStatement 32 hikari thrpt 16 49983,959 4796,385 ops/ms c.z.h.b.StatementBench.cycleStatement 32 bone thrpt 8 7022,146 526,111 ops/ms c.z.h.b.StatementBench.cycleStatement 32 tomcat thrpt 16 28777,731 1011,316 ops/ms c.z.h.b.StatementBench.cycleStatement 32 c3p0 thrpt 16 3367,641 137,937 ops/ms c.z.h.b.StatementBench.cycleStatement 32 vibur thrpt 16 1739,060 45,451 ops/ms 基准(maxPoolSize)(池)模式样本分数错误单位 c、 z.h.b.连接工作台.循环连接32 hikari thrpt 16 1033071 38893操作/质谱 c、 z.h.b.连接台.循环连接32骨thrpt 16 1648954 42610操作/分钟 c、 z.h.b.连接工作台.循环连接32 tomcat thrpt 16 592838 21709操作/质谱 c、 z.h.b.连接台.循环连接32 c3p0 thrpt 16 125857 3666操作/毫秒 c、 z.h.b.连接工作台.循环连接32 vibur thrpt 16 831693 9299操作/质谱 c、 z.h.b.StatementBench.cycleStatement 32 hikari thrpt 16 49983959 4796385 ops/ms c、 z.h.b.StatementBench.cycleStatement 32骨thrpt 8 7022146 526111操作/质谱 c、 z.h.b.StatementBench.cycleStatement 32 tomcat thrpt 16 28777731 1011316操作/毫秒 c、 z.h.b.StatementBench.cycleStatement 32 c3p0 thrpt 16 3367641 137937 ops/ms c、 z.h.b.StatementBench.cycleStatement 32 vibur thrpt 16 1739060 45451 ops/ms 我认为分数越高越好,因此:

  • 为什么HikariCP中的cycleConnection低于BoneCP
  • 考虑到cycleConnection结果,cycleStatement结果是否足以更好地迁移到HikariCP
  • 分数误差列是什么意思
在这些主题中的任何提示、建议等,或到HikariCP的相关迁移,都对我非常有帮助

非常感谢

第一次更新

@brettw,谢谢你的建议,祝贺你出色的工作

我昨晚用nohup./benchmark.sh&进行了一次完整的跑步,得到了以下结果:

Benchmark (maxPoolSize) (pool) Mode Samples Score Score error Units c.z.h.b.ConnectionBench.cycleCnnection 32 hikari thrpt 150 965,017 27,307 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 bone thrpt 150 1528,097 26,963 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 tomcat thrpt 150 473,702 8,068 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 c3p0 thrpt 150 108,527 1,591 ops/ms c.z.h.b.ConnectionBench.cycleCnnection 32 vibur thrpt 150 740,603 14,556 ops/ms c.z.h.b.StatementBench.cycleStatement 32 hikari thrpt 60 47998,292 3112,217 ops/ms c.z.h.b.StatementBench.cycleStatement 32 bone thrpt 120 6210,647 110,100 ops/ms c.z.h.b.StatementBench.cycleStatement 32 tomcat thrpt 150 25919,389 437,232 ops/ms c.z.h.b.StatementBench.cycleStatement 32 c3p0 thrpt 150 3074,133 62,629 ops/ms c.z.h.b.StatementBench.cycleStatement 32 vibur thrpt 150 1517,554 25,027 ops/ms 基准(maxPoolSize)(池)模式样本分数错误单位 c、 z.h.b.连接工作台.循环连接32 hikari thrpt 150 965017 27307操作/质谱 c、 z.h.b.连接台.循环连接32骨thrpt 150 1528097 26963操作/分钟 c、 z.h.b.连接工作台.循环连接32 tomcat thrpt 150 473702 8068操作/质谱 c、 z.h.b.连接工作台.循环连接32 c3p0 thrpt 150 108527 1591 ops/ms c、 z.h.b.连接工作台.循环连接32 vibur thrpt 150 740603 14556操作/质谱 c、 z.h.b.StatementBench.cycleStatement 32 hikari thrpt 60 47998292 3112217 ops/ms c、 z.h.b.StatementBench.cycleStatement 32骨thrpt 120 6210647 110100操作/分钟 c、 z.h.b.StatementBench.cycleStatement 32 tomcat thrpt 150 25919389 437232操作/毫秒 c、 z.h.b.状态台架.循环状态32 c3p0 thrpt 150 3074133 62629操作/毫秒 c、 z.h.b.StatementBench.cycleStatement 32 vibur thrpt 150 1517554 25027 ops/ms 查看扩展输出时,我在日志中看到此异常堆栈跟踪6次:

Iteration 15: [com.zaxxer.hikari.benchmark.StatementBench.cycleStatement-jmh-worker-7] INFO com.zaxxer.hikari.pool.HikariPool - HikariCP pool HikariPool-0 is shutting down. java.lang.IllegalStateException: Attempt to remove an object from the bag that was not borrowed or reserved at com.zaxxer.hikari.util.ConcurrentBag.remove(ConcurrentBag.java:207) at com.zaxxer.hikari.pool.HikariPool.closeConnection(HikariPool.java:394) at com.zaxxer.hikari.pool.HikariPool.releaseConnection(HikariPool.java:223) at com.zaxxer.hikari.proxy.ConnectionProxy.close(ConnectionProxy.java:216) at com.zaxxer.hikari.benchmark.StatementBench$ConnectionState.teardown(StatementBench.java:63) at com.zaxxer.hikari.benchmark.generated.StatementBench_cycleStatement.cycleStatement_Throughput(StatementBench_cycleStatement.java:100) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.openjdk.jmh.runner.LoopBenchmarkHandler$BenchmarkTask.call(LoopBenchmarkHandler.java:204) at org.openjdk.jmh.runner.LoopBenchmarkHandler$BenchmarkTask.call(LoopBenchmarkHandler.java:186) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 迭代15:[com.zaxxer.hikari.benchmark.StatementBench.cycleStatement-jmh-worker-7]INFO com.zaxxer.hikari.pool.HikariPool-HikariPool-0正在关闭 放下。 java.lang.IllegalStateException:尝试从包中移除未借用或保留的对象 位于com.zaxxer.hikari.util.ConcurrentBag.remove(ConcurrentBag.java:207) 在com.zaxxer.hikari.pool.HikariPool.closeConnection上(HikariPool.java:394) 位于com.zaxxer.hikari.pool.HikariPool.releaseConnection(HikariPool.java:223) 在com.zaxxer.hikari.proxy.ConnectionProxy.close(ConnectionProxy.java:216) 位于com.zaxxer.hikari.benchmark.StatementBench$ConnectionState.teardown(StatementBench.java:63) 在com.zaxxer.hikari.benchmark.generated.StatementBench\u cycleStatement.cycleStatement\u吞吐量(StatementBench\u cycleStatement.java:100) 在sun.reflect.GeneratedMethodAccessor1.invoke处(未知源) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中 位于java.lang.reflect.Method.invoke(Method.java:606) 位于org.openjdk.jmh.runner.LoopBenchmarkHandler$BenchmarkTask.call(LoopBenchmarkHandler.java:204) 位于org.openjdk.jmh.runner.LoopBenchmarkHandler$BenchmarkTask.call(LoopBenchmarkHandler.java:186) 在java.util.concurrent.FutureTask.run(FutureTask.java:262)处 位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 运行(Thread.java:745) 最后,我会回答你文章中的其他话题:

  • 更新了pom.xml,以便快速、完整地执行
  • 在干净引导后无法执行测试
  • 有一个带有web应用程序的Tomcat服务器。在测试执行期间,计算机既没有高负载,也没有运行繁重的进程
  • JDK版本是jdk1.7.0_67
  • Linux是x86_64-redhat-Linux-gnu
  • CPU型号为英特尔(R)至强(R)CPU E5-2690@2.90GHz
  • 可能是一个重要的问题:测试已在虚拟机中运行,并与VMWare一起部署
再次感谢

第二次更新: 关于迁移的问题已经变成了另一个关于虚拟化和基准测试的问题,这也是有趣和有用的

现在,我必须关注虚拟环境。当我有时间的时候,我会在一个真实的、直接的环境中运行测试,并将结果带到这里。 我打赌这些测试将显示HikariCP是最好的连接池

@brettw,谢谢你的支持和支持
./benchmark.sh -p pool=hikari,bone