Java HikariCP 的默认maximumPoolSize

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/55026422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 01:10:03  来源:igfitidea点击:

Default maximumPoolSize for HikariCP

javaspringspring-boothikaricpmax-pool-size

提问by Hari

What is the default connection pool size that spring boot HikariCP provides when the container loads?

spring boot HikariCP在容器加载时提供的默认连接池大小是多少?

of course, I am using below properties to setup max cp size, but I was wondering what is the default CP size if we don't give any number in the application.properties file.

当然,我使用以下属性来设置最大 cp 大小,但我想知道如果我们没有在 application.properties 文件中提供任何数字,那么默认的 CP 大小是多少。

spring.datasource.hikari.minimumIdle=5
spring.datasource.hikari.maximumPoolSize=20
spring.datasource.hikari.idleTimeout=30000
spring.datasource.hikari.poolName=SpringBootJPAHikariCP
spring.datasource.hikari.maxLifetime=2000000
spring.datasource.hikari.connectionTimeout=30000

And if I give a max pool size in application.properties as 100 and I use only 20, will that affect my application performance?

如果我在 application.properties 中将最大池大小设置为 100 而我只使用 20,这会影响我的应用程序性能吗?

回答by Dzmitry Krivolap

maximumPoolSize

最大池大小

Default: 10

默认值:10

HicariCP Documentation contains default properties: https://github.com/brettwooldridge/HikariCP

HicariCP 文档包含默认属性:https: //github.com/brettwooldridge/HikariCP

Read about Pool Size here:Maximum Connection Pool Size

在此处阅读池大小:最大连接池大小