HikariCP
HikariCP copied to clipboard
Unable to create variable pool with starting size of 0 connections
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;
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.