Giter VIP home page Giter VIP logo

hikaricp-benchmark's Introduction

Dependency Status

ConnectionCycle measures cycles of DataSource.getConnection()/Connection.close(). StatementCycle measures cycles of Connection.prepareStatement(), Statement.execute(), Statement.close().

JMH Connection Pool Microbenchmarks

This set of microbenchmaks was developed to refine the HikariCP JDBC connection pool implementation, but it actually runs the same benchmarks across multiple pools.

We have come to understand that benchmarking on the JVM, which employs Dead Code Elimination (DCE), lock-coalescing, inlining, loop-unrolling, on-stack replacement (OSR) and a myriad of other tricks, renders most attempts at benchmarking completely invalid -- including our own original benchmarks. Read all the things that [even smart] people get wrong about benchmarking on the JVM.

The Oracle JVM performance team, primarily Aleksey Shipilёv, developed a microbenchmarking framework called JMH. It provides the infrastructure (if used properly) for accurate comparative measurement of JVM-based execution. If you are interested in microbenchmarking at all, or just curious about all the wonderful things the JVM does, I highly recommend reading this slideshare.

How to run?

  • git clone https://github.com/brettwooldridge/HikariCP-benchmark.git
  • cd HikariCP-benchmark
  • mvn clean package
  • ./benchmark.sh

The benchmark.sh script is a wrapper around JMH execution. A full run of the benchmark will take about 45 minutes for all pools.

There are several more options you can provide to the benchmark.sh. There are a lot actually, but these are most useful...

Specify Shorter Runs
There are two options provided by the script: quick and medium. quick will take about 5 minutes to run, medium will take about 20 minutes -- for all pools. It is extrememly boring to watch, and you can't do anything else on the PC where the benchmark is running without affecting the results, so have dinner, run some errands, etc.

./benchmark.sh quick

If specified with other options, quick or medium must be the first option.


Specify Specific Pools

./benchmark.sh -p pool=hikari,bone

Where pool is a comma-separated list (hikari, dbcp2, tomcat, c3p0, vibur). Specifying a specific pool or subset of pools will shorten run times.


Specify Pool Size

./benchmark.sh -p maxPoolSize=16

Pool size is only applicable for the Connection Cycle test, attempting to run the Statement Cycle test with a pool smaller than the number of threads (8) will result in testing failures. The Connection Cycle test runs with 8 threads, so to test a contrained pool condition set maxPoolSize to a smaller number (eg. 4).


Specify which Benchmark
There are two benchmarks in the suite currently: ConnectionBench and StatementBench. By default both benchmarks are run, but if you want to run one or the other you can use a JMH option using a regex (regular experession) to do so. For example, to only run the StatementBench use:

./benchmark.sh ".*Statement.*"

All of the options can be combined:

./benchmark.sh medium -p pool=hikari,vibur -p maxPoolSize=4 ".*Connection.*"

hikaricp-benchmark's People

Contributors

brettwooldridge avatar chanjarster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hikaricp-benchmark's Issues

mvn clean package failed

An exception has occurred in the compiler (1.8.0_144). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.IllegalStateException: endPosTable already set
	at com.sun.tools.javac.util.DiagnosticSource.setEndPosTable(DiagnosticSource.java:136)
	at com.sun.tools.javac.util.Log.setEndPosTable(Log.java:350)
	at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:667)
	at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.<init>(JavacProcessingEnvironment.java:892)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.next(JavacProcessingEnvironment.java:921)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1187)
	at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
	at com.sun.tools.javac.main.Main.compile(Main.java:523)
	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:125)
	at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:169)
	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:825)
	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

Tomcat pool performance in DbDownTest.java

Hi!

In your (very good) article Bad Behavior: Handling Database Down you observe the following about Tomcat's validate-on-checkout behaviour: "Tomcat returns a connection seemingly ignoring setTestOnBorrow(true) as the validation query could not possibly succeed."

I experienced the same issue and found that there is a second config setting affecting the behaviour of setTestOnBorrow(true), namely setValidationInterval(milliseconds) that will effectively limit how often the testOnBorrow will be executed. The default is 30 seconds. After setting this to a 1000 ms (or lower) the validation query did run and it didn't give me bad connections anymore (in my own test).

Please see the documentation for both testOnBorrow and validationInterval here: https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html

I'm guessing this might result in a slightly better grade for the Tomcat pool :)

Could you add BeeCP into the benchmark project ? Thanks.

pom.xml

<dependency>
	<groupId>com.github.chris2018998</groupId>
	<artifactId>BeeCP</artifactId>
	<version>1.5.0</version>
</dependency>

'BenchBase.java'

BenchBase.txt

1: import block

.....
import cn.beecp.BeeDataSource;
import cn.beecp.BeeDataSourceConfig;

2: pool list Param

@Param({ "hikari", "dbcp2", "tomcat", "c3p0", "vibur", "druid", "druid-stat", "druid-stat-merge" ,"beeCP-compete","beeCP-fair"})

3: pool setup block

        case "beeCP-compete":
             setupBeeCPWithCompete();
	     break;
	case "beeCP-fair":
             setupBeeCPWithFair();
             break;

4: pool close block

        case "beeCP-compete":
            ((BeeDataSource) DS).close();
            break;   
	case "beeCP-fair":
            ((BeeDataSource) DS).close();
            break; 

5: pool block

    private void setupBeeCPWithCompete(){
		BeeDataSourceConfig config = new BeeDataSourceConfig(
			"com.zaxxer.hikari.benchmark.stubs.StubDriver", 
			jdbcUrl,
			"brettw", 
			"");	
		config.setMaxActive(maxPoolSize);
		config.setInitialSize(MIN_POOL_SIZE);
		config.setMaxWait(8000);
		config.setPreparedStatementCacheSize(10);
		config.setConnectionTestSQL("select 1 from dual");
		config.setTestOnBorrow(true);
		DS = new BeeDataSource(config);
    }
	
    private void setupBeeCPWithFair(){
		BeeDataSourceConfig config = new BeeDataSourceConfig(
			"com.zaxxer.hikari.benchmark.stubs.StubDriver", 
			jdbcUrl,
			"brettw", 
			"");	
		config.setMaxActive(maxPoolSize);
		config.setInitialSize(MIN_POOL_SIZE);
		config.setMaxWait(8000);
		config.setPreparedStatementCacheSize(10);
		config.setConnectionTestSQL("select 1 from dual");
		config.setTestOnBorrow(true);
		config.setFairMode(true);
		DS = new BeeDataSource(config);
    }

Test against actual RDS Instance

Hello,

I think the Readme is quite unclear about what database these connection pools are actually testing against. When I try to run the command ./benchmark.sh quick -p pool=hikari -p jdbcUrl=jdbc:postgresql://rdsHost/database I don't actually see the number of connection to my RDS increase. How is it actually testing these pools? Are there different params I should be passing in to actually test these pools against my hardware?

Sorry if I'm being dumb, I'm simply trying to test how a bunch of database pools would perform against our hardware. I'd also like to test Hikari against tools like pgbouncer and AWS Proxy which are standalone connection poolers. Thank you for the help!

[QUESTION]: Is the 'cycles/ms' benchmark single-threaded?

Hello there,

I know it's pretty old, but I'm trying to understand the whole 50,273 connection-cycles/ms benchmark. Such a number usually makes sense in a single-threaded situation, but below the diagram, I am reading that 32 threads/connections were used. But that confuses me even more, because the CPU referenced has only 4 cores - so what would be the point of 32 threads?!? If you can help me understand how this number was calculated and/or aggregated, that would be greatly appreciated.

Many thanks in advance...

Stuck up with HikariCP: JZ0C0: Connection is already closed issue

I am getting Connection is already closed issue, for a CommandLineRunner -Spring Boot Application. Here is the tech stack I am using

SpringBoot v2.1.7
Sybase DB v16.x with jconn4
HikarCP - Configuration info :
`DB with SpringBoot v2.1.7)
java spring-boot sybase-ase hikaricp
I am getting Connection is already closed issue, for a CommandLineRunner -Spring Boot Application. Here is the tech stack I am using

SpringBoot v2.1.7
Sybase DB v16.x with jconn4
HikarCP - Configuration info :

DEBUG] 2020-05-22 10:51:58.449 [main] o.s.j.d.DataSourceUtils - Fetching JDBC Connection from DataSource
[DEBUG] 2020-05-22 10:51:58.450 [main] c.z.h.HikariConfig - GBSHikariCP - configuration:
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - allowPoolSuspension.............false
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - autoCommit......................true
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - catalog.........................none
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - connectionInitSql...............none
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - connectionTestQuery............."SELECT 1"
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - connectionTimeout...............30000
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - dataSource......................none
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - dataSourceClassName.............none
[DEBUG] 2020-05-22 10:51:58.451 [main] c.z.h.HikariConfig - dataSourceJNDI..................none
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - dataSourceProperties............{password=}
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - driverClassName................."com.sybase.jdbc4.jdbc.SybDriver"
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - healthCheckProperties...........{}
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - healthCheckRegistry.............none
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - idleTimeout.....................30000
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - initializationFailTimeout.......1
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - isolateInternalQueries..........false
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - jdbcUrl.........................jdbc:sybase:Tds:xxxxx.xxx.xx.xx:11111/SOMEDB
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - leakDetectionThreshold..........2500
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - maxLifetime.....................90000
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - maximumPoolSize.................20
[DEBUG] 2020-05-22 10:51:58.452 [main] c.z.h.HikariConfig - metricRegistry..................none
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - metricsTrackerFactory...........none
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - minimumIdle.....................5
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - password........................
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - poolName........................"HikariCP"
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - readOnly........................false
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - registerMbeans..................false
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - scheduledExecutor...............none
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - schema.........................."dbo"
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - threadFactory...................internal
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - transactionIsolation............default
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - username........................"usr111"
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - validationTimeout...............10000Here is the stack trace I see on the STS Console ....................false
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - registerMbeans..................false
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - scheduledExecutor...............none
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - schema.........................."dbo"
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - threadFactory...................internal
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - transactionIsolation............default
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - username........................"usr111"
[DEBUG] 2020-05-22 10:51:58.453 [main] c.z.h.HikariConfig - validationTimeout...............10000
Here is the stack trace I see on the STS Console

2020-05-22 10:51:58.857 [main] c.z.h.p.PoolBase - HikariCP - Closing connection com.sybase.jdbc4.jdbc.SybConnection@4a183d02: (Failed to create/setup connection)
[DEBUG] 2020-05-22 10:51:58.859 [main] c.z.h.p.PoolBase - GBSHikariCP - Closing connection com.sybase.jdbc4.jdbc.SybConnection@4a183d02 failed
java.sql.SQLException: JZ0C0: Connection is already closed.
at com.sybase.jdbc4.jdbc.ErrorMessage.raiseError(Unknown Source)
at com.sybase.jdbc4.jdbc.SybConnection.checkConnection(Unknown Source)
at com.sybase.jdbc4.jdbc.SybConnection.close(Unknown Source)
at com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:135)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:380)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:319)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:356)
at org.springframework.boot.autoconfigure.orm.jpa.DatabaseLookup.getDatabase(DatabaseLookup.java:73)
at org.springframework.boot.autoconfigure.orm.jpa.JpaProperties.determineDatabase(JpaProperties.java:142)
at org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter(JpaBaseConfiguration.java:113)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$9d0516b2.CGLIB$jpaVendorAdapter$7()
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$9d0516b2$$FastClassBySpringCGLIB$$9e5bd134.invoke()
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
at org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration$$EnhancerBySpringCGLIB$$9d0516b2.jpaVendorAdapter()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1251)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1171)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1251)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1171)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203)
at com.xxx.xx.xxx.jrt.JOBRunTP.main(JOBRunTP.java:44)

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: JZ0C0: Connection is already closed.
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:319)
... 61 common frames omitted
Caused by: java.sql.SQLException: JZ0C0: Connection is already closed.
at com.sybase.jdbc4.jdbc.SybConnection.getAllExceptions(Unknown Source)
at com.sybase.jdbc4.jdbc.SybConnection.handleSQLE(Unknown Source)
at com.sybase.jdbc4.jdbc.SybConnection.isReadOnly(Unknown Source)
at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:413)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:374)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
`

tomcat outperforms hikari in 2.6.1 StatementBench test

Summary of result

# Run complete. Total time: 00:34:00

Benchmark                       (jdbcUrl)  (maxPoolSize)  (pool)   Mode  Cnt       Score      Error   Units
ConnectionBench.cycleCnnection  jdbc:stub             32  hikari  thrpt  150   52042.195 ? 6787.533  ops/ms
ConnectionBench.cycleCnnection  jdbc:stub             32   dbcp2  thrpt  150     351.069 ?    7.283  ops/ms
ConnectionBench.cycleCnnection  jdbc:stub             32  tomcat  thrpt  150     455.599 ?    5.026  ops/ms
ConnectionBench.cycleCnnection  jdbc:stub             32    c3p0  thrpt  150     112.956 ?    0.489  ops/ms
ConnectionBench.cycleCnnection  jdbc:stub             32   vibur  thrpt  150    1724.984 ?   28.305  ops/ms
StatementBench.cycleStatement   jdbc:stub             32  hikari  thrpt  150   39318.175 ? 4012.550  ops/ms
StatementBench.cycleStatement   jdbc:stub             32   dbcp2  thrpt  150     259.052 ?   54.949  ops/ms
StatementBench.cycleStatement   jdbc:stub             32  tomcat  thrpt  150  173265.428 ?  218.890  ops/ms
StatementBench.cycleStatement   jdbc:stub             32    c3p0  thrpt  150   17910.245 ?  605.792  ops/ms
StatementBench.cycleStatement   jdbc:stub             32   vibur  thrpt  150   61663.926 ?  220.897  ops/ms

The 'bone' pool mentioned in Readme.md is undefined.

When I ran the ./benchmark.sh -p pool=hikari,bone command following the guide , NullPointException got thrown.

I checked the code of BenchBase, it seemed that 'bone' was undefined.

@Param({ "hikari", "dbcp", "dbcp2", "tomcat", "c3p0", "vibur", "one" }) public String pool;

    switch (pool)
    {
    case "hikari":
        setupHikari();
        break;
    case "tomcat":
        setupTomcat();
        break;
    case "dbcp":
        setupDbcp();
        break;
    case "dbcp2":
        setupDbcp2();
        break;
    case "c3p0":
        setupC3P0();
        break;
    case "vibur":
        setupVibur();
        break;
    case "one":
        setupOne();
        break;
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.