0

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

Raptor
  • 53,206
  • 45
  • 230
  • 366
psb
  • 55
  • 7
  • 1
    Did you seen that? https://stackoverflow.com/questions/6196988/what-is-the-maximum-and-minimum-size-of-connection-pool-ado-net-supports-in-the – D-Shih Jan 31 '18 at 07:43

1 Answers1

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.

Zohar Peled
  • 79,642
  • 10
  • 69
  • 121