How to restrict initial pool size in hikaricp?

前端 未结 3 1380
离开以前
离开以前 2021-01-20 01:38

I used to have a tomcat connection pool configuration restricting the initial pool size: spring.datasource.tomcat.initial-size=2

Now switch

3条回答
  •  死守一世寂寞
    2021-01-20 02:08

    You can use these properties provided in spring boot:

    spring.datasource.hikari.minimumIdle=5
    spring.datasource.hikari.maximumPoolSize=8
    

    and then:

    spring.datasource.hikari.idleTimeout=120000
    

    to limit the life of idle connections, but hikari doesn't give you such property for initial number of connections.

提交回复
热议问题