HikariCP
光 HikariCP・A solid, high-performance, JDBC connection pool at last.
Install / Use
/learn @brettwooldridge/HikariCPREADME
[![][Build Status img]][Build Status]
[![][Coverage Status img]][Coverage Status]
[![][license img]][license]
[![][Javadocs img]][Javadocs]
[![][Librapay img]][Librapay]
Fast, simple, reliable. HikariCP is a "zero-overhead" production ready JDBC connection pool. At roughly 165Kb, the library is very light. Read about how we do it here.
<sup>"Simplicity is prerequisite for reliability."<br> - Dr. Edsger Dijkstra</sup>
[!IMPORTANT] In order to avoid a rare condition where the pool goes to zero and does not recover it is necessary to configure TCP keepalive. Some JDBC drivers support this via properties, for example
tcpKeepAlive=trueon PostgreSQL, but in any case it can also be configured at the OS-level. See Setting OS TCP Keepalive and/or TCP keepalive for a better PostgreSQL experience.
Index
Artifacts
Java 11+ maven artifact:
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>7.0.2</version>
</dependency>
Java 8 maven artifact (deprecated):
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>4.0.3</version>
</dependency>
Java 7 maven artifact (deprecated):
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java7</artifactId>
<version>2.4.13</version>
</dependency>
Java 6 maven artifact (deprecated):
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java6</artifactId>
<version>2.3.13</version>
</dependency>
:checkered_flag: JMH Benchmarks
Microbenchmarks were created to isolate and measure the overhead of pools using the JMH microbenchmark framework. You can checkout the HikariCP benchmark project for details and review/run the benchmarks yourself.

- One Connection Cycle is defined as single
DataSource.getConnection()/Connection.close(). - One Statement Cycle is defined as single
Connection.prepareStatement(),Statement.execute(),Statement.close().
:microscope: Analyses
Spike Demand Pool Comparison
<a href="https://github.com/brettwooldridge/HikariCP/blob/dev/documents/Welcome-To-The-Jungle.md"><img width="400" align="right" src="https://github.com/brettwooldridge/HikariCP/wiki/Spike-Hikari.png"></a> Analysis of HikariCP v2.6, in comparison to other pools, in relation to a unique "spike demand" load.
The customer's environment imposed a high cost of new connection acquisition, and a requirement for a dynamically-sized pool, but yet a need for responsiveness to request spikes. Read about the spike demand handling here. <br/> <br/>
You're [probably] doing it wrong
<a href="https://github.com/brettwooldridge/HikariCP/wiki/About-Pool-Sizing"><img width="200" align="right" src="https://github.com/brettwooldridge/HikariCP/wiki/Postgres_Chart.png"></a> AKA "What you probably didn't know about connection pool sizing". Watch a video from the Oracle Real-world Performance group, and learn about why database connections do not need to be so numerous as they often are. In fact, too many connections have a clear and demonstrable negative impact on performance; a 50x difference in the case of the Oracle demonstration. Read on to find out. <br/>
WIX Engineering Analysis
<a href="https://www.wix.engineering/blog/how-does-hikaricp-compare-to-other-connection-pools"><img width="180" align="left" src="https://github.com/brettwooldridge/HikariCP/wiki/Wix-Engineering.png"></a> We'd like to thank the guys over at WIX for the unsolicited and deep write-up about HikariCP on their engineering blog. Take a look if you have time. <br/> <br/> <br/>
Failure: Pools behaving badly
Read our interesting "Database down" pool challenge.
"Imitation Is The Sincerest Form Of Plagiarism" - <sub><sup>anonymous</sup></sub>
Open source software like HikariCP, like any product, competes in the free market. We get it. We understand that product advancements, once public, are often co-opted. And we understand that ideas can arise from the zeitgeist; simultaneously and independently. But the timeline of innovation, particularly in open source projects, is also clear and we want our users to understand the direction of flow of innovation in our space. It could be demoralizing to see the result of hundreds of hours of thought and research co-opted so easily, and perhaps that is inherent in a free marketplace, but we are not demoralized. We are motivated; to widen the gap.
:family: User Testimonials
If you like this project, consider leaving a word for us on social media:
:gear: Configuration (knobs, baby!)
HikariCP comes with sane defaults that perform well in most deployments without additional tweaking. Every property is optional, except for the "essentials" marked below.
<sup>📎</sup> HikariCP uses milliseconds for all time values.
🚨 HikariCP relies on accurate timers for both performance and reliability. It is imperative that your server is synchronized with a time-source such as an NTP server. Especially if your server is running within a virtual machine. Why? Read more here. Do not rely on hypervisor settings to "synchronize" the clock of the virtual machine. Configure time-source synchronization inside the virtual machine. If you come asking for support on an issue that turns out to be caused by lack time synchronization, you will be taunted publicly on Twitter.
Essentials
🔤dataSourceClassName<br/>
This is the name of the DataSource class provided by the JDBC driver. Consult the
documentation for your specific JDBC driver to get this class name, or see the [table](https://github.com/brettwooldridge/HikariCP#popular-datasource-class
Related Skills
node-connect
337.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.3kCommit, push, and open a PR






