I. Overview
Springboot2 default database connection pool selected HIKARICP Why choose HIKARICP Reason one, code quantity reason two, word of mouth reason three, speed reason four, stability reason five, Reliability HIKARICP Why so fast optimization and refinement of bytecode better concurrent collection class implementations use Fastlist overrides ARRAYLISTHIKARICP
Second, Spring Boot 2 default database connection pool selected HIKARICP
The default database connection pool is changed from Tomcat to HIKARICP. If you use Spring.datasource.type to force a Hikari connection pool in a Tomcat application, you can remove this override.
Third, why Choose HIKARICP
HIKARICP is a database connection pool of a rising star, known as the best performance, can be perfect pk off the other connection pool, is a high-performance JDBC connection pool, based on BONECP do a lot of improvement and optimization. Its author also has another open source work-the high-performance JSON parser Hikarijson.
See more performance comparisons
HIKARICP can provide monitoring functions, such as metrics, you can see the author of this article "Ray Chaser series" HIKARICP Connection pool monitoring indicators combat.
In addition, monitoring aspects, skywalking, pinpoint, mycat these agents can also be done, after service mesh popularization more can be monitored, such as sharding-jdbc can also do monitoring, Datamesh, Sidecar can also be monitored.
Configuration
# Hikari'll use the above plus the following to setup connection Poolingspring.datasource.type=Com.zaxxer.hikari.HikariDataSourcespring.datasource.hikari.minimum-idle=5Spring.datasource.hikari.maximum-pool-size= theSpring.datasource.hikari.auto-commit=trueSpring.datasource.hikari.idle-timeout=30000Spring.datasource.hikari.pool-name=DatebookHikariCPspring.datasource.hikari.max-lifetime=1800000spring.datasource.hikari.connection-timeout=30000spring.datasource.hikari.connection-test-query=select1
Of
005-spring Boot 2.0.4-JDBC Upgrade