当前位置:网站首页>Additional: brief description of hikaricp connection pool; (I didn't go deep into it, but I had a basic understanding of hikaricp connection pool)
Additional: brief description of hikaricp connection pool; (I didn't go deep into it, but I had a basic understanding of hikaricp connection pool)
2022-06-26 02:46:00 【Small withered forest】
explain :
(1) Why did you write this blog ?: stay 【16: Chapter two : Architecture back end project :12: To configure mybatis;( stay 【imooc-news-dev-service-user】 This micro service sub project , To configure )】 in , Our database connection pool uses HikariCP Connection pool ;;; therefore , Wrote this blog , Give a brief introduction ;
(2) The articles referenced in this blog are :
●【Hikari Connection pool 】, The author of this article is 【 Wang Liuliu's IT daily 】;
●【Spring Series of HikariCP Connection pool 】, The author of this article is 【 A Niu, programmer 】;
Catalog
One : Reference article 1:Hikari Connection pool ;
Two : Reference article 2:Spring Series of HikariCP Connection pool ;
One : Reference article 1:Hikari Connection pool ;
Reference from 【Hikari Connection pool 】, The author of this article is 【 Wang Liuliu's IT daily 】;
hikari: # Connection pool name pool-name: DateHikariCP # Minimum number of idle connections minimum-idle: 5 # Maximum free connection lifetime , Default 600000(10 minute ) idle-timeout: 180000 # The maximum number of connections in the connection pool , Default 10 maximum-pool-size: 10 # This property controls the default auto commit behavior for connections returned from the pool , The default value is :true auto-commit: true # This property controls the maximum lifetime of connections in the pool , value 0 It means infinite life cycle , Default 1800000 namely 30 minute max-lifetime: 1800000 # Database connection timeout , Default 30000(30 second ) onnection-timeout: 30000 # Query statement to test whether the connection is available connection-test-query: SELECT 1
Two : Reference article 2:Spring Series of HikariCP Connection pool ;
Reference from 【Spring Series of HikariCP Connection pool 】, The author of this article is 【 A Niu, programmer 】;
/** * The following three notes mean when classpath There is HikariDataSource.class, also Spring There is no configuration in the context DataSource Of bean * also spring.datasource.type The value of is com.zaxxer.hikari.HikariDataSource When ,SpringBoot Automatically help us choose the default connection pool is HikariDataSource */ @ConditionalOnClass({HikariDataSource.class}) @ConditionalOnMissingBean({DataSource.class}) @ConditionalOnProperty(name = {"spring.datasource.type"},havingValue = "com.zaxxer.hikari.HikariDataSource",matchIfMissing = true) static class Hikari { Hikari() { } @Bean @ConfigurationProperties(prefix = "spring.datasource.hikari") HikariDataSource dataSource(DataSourceProperties properties) { HikariDataSource dataSource = (HikariDataSource)DataSourceConfiguration.createDataSource(properties, HikariDataSource.class); if (StringUtils.hasText(properties.getName())) { dataSource.setPoolName(properties.getName()); } return dataSource; } }# These four configurations are used for different data sources spring.datasource.url=jdbc:mysql://localhost:3306/test spring.datasource.username=root spring.datasource.password=123456 spring.datasource.driver-class-name=com.mysql.jdbc.Driver # The following configuration items are hikari Unique configuration # The maximum length of time to wait for the connection pool to allocate the connection ( millisecond ), Connections that have not been available for more than this period of time occur SQLException, Default :30 second spring.datasource.hikari.connection-timeout=30000 # Minimum connections spring.datasource.hikari.minimum-idle=5 # maximum connection spring.datasource.hikari.maximum-pool-size=15 # Automatic submission spring.datasource.hikari.auto-commit=true # A connection idle The maximum duration of a state ( millisecond ), Timeout is released (retired), Default :10 minute spring.datasource.hikari.idle-timeout=600000 # Connection pool name spring.datasource.hikari.pool-name=DatebookHikariCP # A connected life span ( millisecond ), Time out and not used is released (retired), Default :30 minute 1800000ms, It is recommended to set the timeout less than the database 60 second spring.datasource.hikari.max-lifetime=28740000 spring.datasource.hikari.connection-test-query=SELECT 1 # The following is for MYSQL Configuration parameters of the driver # The number of statements cached in each connection . The default value is conservative 25. It is recommended that it be set to 250-500 Between spring.datasource.hikari.prepStmtCacheSize = 300 # Cached prepared SQL The maximum length of a statement , The default value is 256, But often this length is not enough spring.datasource.hikari.prepStmtCacheSqlLimit = 2048 # Cache switch , If this is set to false, Neither of the above two parameters takes effect spring.datasource.hikari.cachePrepStmts = true # Newer versions of MySQL Support prepared statements on the server side , This can provide substantial performance improvements spring.datasource.hikari.useServerPrepStmts = trueHikariCP Official address : https://github.com/brettwoold...
边栏推荐
- 请指教同花顺软件究竟是什么?在线开户安全么?
- Dreamcamera2 video recording, playing without sound, recording function is normal, using a third-party application for video recording, playing with sound
- Cox 回归模型
- . Net7 miniapi (special part):preview5 optimizes JWT verification (Part 2)
- 官方零基础入门 Jetpack Compose 的中文课程来啦!
- PyQt theme
- IPhone 13 screen stuck black, unable to shut down? How to solve
- Thirty ninth step
- What is flush software? Is online account opening safe?
- Redis Lua沙盒绕过命令执行(CVE-2022-0543)
猜你喜欢

Possible values for @supply in kotlin

Deep understanding of distributed cache design
![2022-06-25:给定一个正数n, 表示有0~n-1号任务, 给定一个长度为n的数组time,time[i]表示i号任务做完的时间, 给定一个二维数组matrix, matrix[j] = {a,](/img/93/d95255bae20b138851bdc8a50f8647.png)
2022-06-25:给定一个正数n, 表示有0~n-1号任务, 给定一个长度为n的数组time,time[i]表示i号任务做完的时间, 给定一个二维数组matrix, matrix[j] = {a,

How to check and cancel subscription auto renewal on iPhone or iPad

GD32 ADC采集电压

业务流程图设计

How do I fix the iPhone green screen problem? Try these solutions

UTONMOS:以数字藏品助力华夏文化传承和数字科技发展

How do I take a screenshot of the iPad? 7 ways to take quick screenshots of iPad

Chapter I: essential information collection of penetration test
随机推荐
A few simple ways for programmers to exercise their waist
【解决】联想拯救者vmware启动虚拟机蓝屏重启问题
音视频与CPU架构
How to add a regression equation to a plot in R
How to delete gridlines in ggplot2 (with examples)
【flask入门系列】flask处理请求和处理响应
Oracle练习
小 P 周刊 Vol.10
Create a nonlinear least squares test in R
A high-frequency interview question from a large factory: tell me about the solution of high and low interface idempotence? Solutions are attached.
[defect detection] automatic defect detection of printed circuit board based on Matlab GUI [including Matlab source code 1912]
@Query difficult and miscellaneous diseases
在同花顺网上开户安全吗?如何网上开一个券商账户
R 语言马尔可夫链蒙特卡洛:实用介绍
IPhone 13 screen stuck black, unable to shut down? How to solve
Wechat launched a web version transmission assistant. Is it really easy to use?
ORB-SLAM3论文概述
Binary search
In depth good article: what is supernetting?
Version management tool usage




