How HikariCP can be initialized with some initial no of connection created at the time of initialization?

64 views
Skip to first unread message

Adnan Sohail

unread,
Apr 3, 2020, 7:58:54 AM4/3/20
to HikariCP
Hello everyone,

I want to use HikariCP in a transaction processing application. So, I don't want to impact the first few transaction with the impact of new connection creation. So, can anyone guide, how HikariCP can be initialized with some initial no of connection created at the time of initialization?

Regards,
Adnan Sohail

Jens

unread,
Apr 3, 2020, 11:08:39 AM4/3/20
to HikariCP
HikariCP has two configuration parameters for connection count: minimumIdle and maximumPoolSize. By default minimumIdle will be the same value as maximumPoolSize, so when you set maximumPoolSize to 10, then HikariCP will create 10 connections when the pool starts.

If you set minimumIdle to 5 then only 5 connections will be created on pool start and the pool will increase to 10 connections dynamically once work load increases.

-- J.

Adnan Sohail

unread,
Apr 3, 2020, 1:18:33 PM4/3/20
to HikariCP
Thanks for clarification J.

That's helpful. Please clarify one more thing.

Does Hikari creates all of these connection on initialization of HikariDataSource or is there any other method to start the pool?

Ragards,
Adnan
Reply all
Reply to author
Forward
0 new messages