1

I have a Visual Studio 2010 web project that connects to a SQL Server database using the Entity Framework. When I run the 32 bit application via VS2010 it uses the Visual Studio Development Server. After running the application I use 'exec sp_who2' on SQL Server from time to time to see how many database connections there are from the server, and it never gets above about 6. This is the expected behaviour because connection pooling is being used and so connections reused.

I run exactly the same 32 bit build from IIS 7.5 and after a short time it hits the 100 connection pool limit and stops working. The code is identical, the database is identical and so the only difference is running under IIS 7.5 instead of the Development Server. I have enabled connection pooling in the connection string. In fact the connection string is identical in both cases.

Any ideas why the connection pooling is not working on IIS? Yes, I have pooling=true within the connection string. Yes, I do correctly close all connections when they are no longer needed.

UPDATE: Setting the max pool size to 200 seems to allow the IIS scenario to keep working as it does not seem to get above about 150. But why would the development server only ever need about 6 and the IIS version needs around 150 in the pool. They are both using the same database in the same way with the same connection string.

Phil Wright
  • 22,580
  • 14
  • 83
  • 137

0 Answers0