brettwooldridge / HikariCP

光 HikariCP・A solid, high-performance, JDBC connection pool at last.
Apache License 2.0
20.05k stars 2.94k forks source link

Unable to create variable pool with starting size of 0 connections #1870

Open murtaza13 opened 3 years ago

murtaza13 commented 3 years ago

I have a distributed system that connects to around 150 different schemas/databases at the same time. For connecting to each schema/database, the application spins up a separate connection pool. Application has varying usage, sometimes it needs active connections to only 10 schemas, sometimes it needs active connections for all.

In order to better manage resources, I want to have Hikari connection pool, which should have 0 connection by default, and then as the need grows, the connections should grow out to a specified threshold and then come back to 0.

My configurations are such:

hikariConfig.setMinimumIdle(0);
hikariConfig.setMaximumPoolSize(10);
hikariConfig.setIdleTimeout(180000);

However, I see at least 1 active connection per pool in my MySQL database when I run sql

> show processList;

murtaza13 commented 3 years ago

Can I please have someone repsond to the issue I am facing above? Why does HikariCP have to maintain atleast 1 connection to the database at all times even when the minimum idle connections are 0.