0

In ADO.net SQL server connection, how many connections are created by default in one connection pool?

1

1 Answer 1

2

The number of connections that will be created in the connection pool is either 1 or the number specified as the MinPoolSize, if that number is bigger.
From Microsoft doc on SQL Server Connection Pooling

A connection pool is created for each unique connection string. When a pool is created, multiple connection objects are created and added to the pool so that the minimum pool size requirement is satisfied.

The minimum number of connections has a default value of 0,
meaning that the connection pool will be closed after a period of inactivity:

If MinPoolSize is either not specified in the connection string or is specified as zero, the connections in the pool will be closed after a period of inactivity. However, if the specified MinPoolSize is greater than zero, the connection pool is not destroyed until the AppDomain is unloaded and the process ends. Maintenance of inactive or empty pools involves minimal system overhead.

The maximum number of connections in the connection pool as a default value of 100.

Connections are added to the pool as needed, up to the maximum pool size specified (100 is the default). Connections are released back into the pool when they are closed or disposed.

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.