We recently moved our company website to a new host. This is an ASP.NET site with C # code that connects to an MS SQL server.
Since the site is moving to a new server, the site exceeds the connection pool limit (which is not explicitly set, so I believe that the default size is 100). Inspecting open processes using the SQL Server Management Studiorevealed environment, that every database call seems to remain open, and indeed, in the code I can find not explicitly not closed connections at all.
Database connections are performed as follows:
DSLibrary.DataProviders.SqlProvider db = new DSLibrary.DataProviders.SqlProvider(Defaults.ConnStr);
There is very little documentation about this DSLibrary, and I assume this is a library written by the original website developer. None of the members of the DSLibrary class explicitly closes the connection - and they are not defined in the using block to automatically close the connection.
My question is 2 times.
- How would we not encounter this problem when the site was on another host for almost 3 years? Is it automatically deleted to close unused connections that I do not have implemented on the SQL server?
- Will I be better off rewriting every connection and procedure to explicitly open and close the connection database?
UPDATE The maximum number of concurrent connections property (Server Properties → Connections) is set to 0.
If I run the website in debug mode on my development machine, connecting remotely to the production database, then the connections seem to close properly. This seems to indicate that this is related to how IIS is configured?
UPDATE 2 Configuring the application pool for processing after processes 30 workers stopped the site exceeding the maximum number of connections, but there is currently a limitation of some (session-based persistent) functionality - recently visited the list of items it reboots very quickly and trying to change something through CE is impossible, since you logged out as soon as processes are reworked ...
source share