I have been getting the below error.
System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) I know that this is a question already asked by some users and i have gone through most of those and i learned the usual root causes and the fixes. I learning are below:
- systems is unable to open new connections because connection pool max is reached.(default is 100 and it is set in the connection string)
- Opened connections are not closed, called connection leaking
- More than 100 concurrent connections are being used. Increase the max pool size in the connection string if we have more than 100 simultaneous users.
- Slow queries or open transactions blocks new connections.
- When the connections are being held open by slow query execution/open transactions and instead of being reusing connections the new connection are open and eventually reaches the connection pool maximum.
When i did my research i learned that it connection pool is something which the application maintains.I talked to the application team and they say that it has never occurred earlier(for the last 4 or 5 years) and so it must be something with database server. Our SQL server version earlier was SQL 2008 R2 and we migrated to SQL Server 2016 as the data became huge like 1.5 TB and the performance was bad. After migrating to SQL Server 2016,and fixing some performance issues we were stable,but getting this connection pool error now and then.
How do i go about this connection pool error from the database side.
Thanks