ADO.NET Connection Pool Max Pool Size Limits
25K reputation · 29 Dec 2020, 09:56 UTC
ADO.NET utilizes connection pooling to minimize the overhead of establishing physical database connections. By default, the pool manages connections based on the exact connection string provided, and the Max Pool Size attribute defines the upper limit of physical connections allowed per pool.
When an application reaches this limit and all connections are currently active, subsequent requests must wait for a connection to be returned to the pool or for the Connection Timeout period to expire. There is a design uncertainty regarding the behavior of the pool when connection strings vary by only minor attributes or when managing resources across multiple asynchronous tasks that may hold connections open during long-running I/O operations.
- How does the pool manager handle requests when the
Max Pool Sizeis reached but theConnection Timeouthas not yet elapsed? - What is the impact on pool exhaustion when connection strings are dynamically generated with minor variations?