Too many connections to Sql Server 2008
- by Luis Forero
I have an application in C# Framework 4.0. Like many app this one connects to a data base to get information. In my case this database is SqlServer 2008 Express.
The database is in my machine
In my data layer I’m using Enterprise Library 5.0
When I publish my app in my local machine (App Pool Classic)
Windows Professional
IIS 7.5
The application works fine. I’m using this query to check the number of connections my application is creating when I’m testing it.
SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections,
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0 AND db_name(dbid) = 'MyDataBase'
GROUP BY dbid, loginame
When I start testing the number of connection start growing but at some point the max number of connection is 26. I think that’s ok because the app works
When I publish the app to TestMachine1
• XP Mode Virtual Machine (Windows XP Professional)
• IIS 5.1
It works fine, the behavior is the same, the number of connections to the database increment to 24 or 26, after that they stay at that point no matter what I do in the application.
The problem:
When I publish to TestMachine2 (App Pool Classic)
• Windows Server 2008 R2
• IIS 7.5
I start to test the application the number of connection to the database start to grow but this time they grow very rapidly and don’t stop growing at 24 or 26, the number of connections grow till the get to be 100 and the application stop working at that point.
I have check for any difference on the publications, especially in Windows Professional and Windows Server and they seem with the same parameters and configurations.
Any clues why this could be happening? , any suggestions?