3
votes

Initial and Minimum Pool Size

The minimum number of connections in the pool. This value also determines the number of connections placed in the pool when the pool is first created or when application server starts.

Maximum Pool Size

The maximum number of connections in the pool.

According to the above 2 definitions, if the min pool size is 1 and max pool size is 100 then:

  1. When the pool is first created or when application server starts then only one connection is newly created.
  2. There will be many requests hitting concurrently in the day and will definitely require more connection which will be made in the course of the day which can reach max to 100. But while these connections are made they are not removed from pool until the application server shuts down or we remove the entire pool?

Am I right for these two points?

2
Which connection pool library are you using?Mark Rotteveel

2 Answers

5
votes

The pool size will stay between the limits you describe. As a general idea:

  • Concept #1 is correct.

  • Concept #2 depends on the JDBC connection pool. Typically the connection pool is able to grow and shrink according to the observed usage during the day. Heavy load will make it grow while idleness will make it shrink.

In any case, every JDBC connection pool behaves a little bit differently, so you should check the specific connection pool you want to use.

-1
votes

1 is correct , but 2 assumption is true only if you don't close connection and you don't set max life time for the connection.

Usually you close the connection and then it return/released to the connection pool.

Also 100 max pool size is not needed, Although you didn't specify which connection pool you are using, you can read more about pooling setting in hikari pool size