0

Let say I have a db connection pool of 3 connection.

Does it means that

  1. There are three active TCP connection with db ?
  2. only 3 query can be run in parallel, one query per connection ?
1

1 Answer 1

1

Depends on min max of pool in the configuration of the pool.

If by default you've set the min pool size is 3, then the pool will always have 3 connections to hand out at any time. If all 3 are in use then it will wait to hand out another until one comes in UNLESS pool max size is higher than 3. Then the pool can GROW in size. It's just the overhead of setting up and establishing the connection will be incurred until that max size limit is reached. Once the pool connections has been idle for some period of time, the pool will cut back on connections until the min 3 is again reached.

So to answer your questions directly: DB connection pool of 3 (Assuming this is the MIN value)

  1. Yes there are 3 active connections the pool is managing and will not allow to fall below 3 at any time.
  2. No more than 3 can run depending on max pool size. if 3 is both the min and max pool size then yes you would be limiting what can truly run in parallel.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.