Spring Boot Hikari Default Pool Size




Asked on September 15, 2023
What is the default pool size of HikariCP in Spring Boot application and how to change it? 


Replied on September 15, 2023
The default pool size of HikariCP is 10.

You can check it from HikariCP class com.zaxxer.hikari.HikariConfig

private static final int DEFAULT_POOL_SIZE = 10;

Other default values are

private static final long CONNECTION_TIMEOUT = SECONDS.toMillis(30);
private static final long VALIDATION_TIMEOUT = SECONDS.toMillis(5);
private static final long SOFT_TIMEOUT_FLOOR = Long.getLong("com.zaxxer.hikari.timeoutMs.floor", 250L);
private static final long IDLE_TIMEOUT = MINUTES.toMillis(10);
private static final long MAX_LIFETIME = MINUTES.toMillis(30);
private static final long DEFAULT_KEEPALIVE_TIME = 0L;
private static final int DEFAULT_POOL_SIZE = 10;


Change default value:

To change default pool size, configure maximum-pool-size in application.properties file as below.

spring.datasource.hikari.maximum-pool-size=15







Replied on September 15, 2023
Thanks.

Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us