1
votes

So this issue is NOT one of having too many connection strings or connection strings not being disposed of properly. ASP.NET Sql Server stored session has been working great for months with decent traffic on the website, now I am getting many Unable to connect to SQL Server session database - The wait operation timed out exceptions. There is plenty of memory available for the database, the database has plenty of memory allocated. There is just a few users on the website when it is throwing errors.

I have two blade servers sitting right next to each other and very low traffic to the website so I shouldn't need to increase the connection timeout from the default 15 seconds.

I am using Windows Authentication and I can connect via SSMS and query my ASPSession database that is being used as the persistence layer for ASP.SESSION no problem.

I just have no were to go on this error currently.

2
First thought: increase default timeout in your ADO.NET connection string. By default it is 15 seconds. - bjnr
Well I could do that but why would I need to do, the response from my database server should never be more than a second, my servers are blade server siting right next to each in a colocation. - Brian Ogden
Windows Authentication and I can connect via SSMS and query my database that is being used as the persistence layer for ASP.SESSION. - Brian Ogden
for investigation purpose, in case the behaviour is not reproduced you know where the problem come from... - bjnr
I have never seen a connection succeed after 15sec have passed. Increasing the timeout is most likely not a solution. - usr

2 Answers

0
votes

Looks like the issue an I/O error with the raid on my database server. Had to swap out a hard drive and all seems well.

0
votes

I had the same issue, and I didn't know why, because I setted the timeout for 300 seconds(5minutes) at app.config, elsewhise I didn't notice when I was using sqlCommand the timeout of connection was 300 seconds, but for the sqlCommand was 30 seconds, so I setted the sqlCommand.ConnectionTimeout = 300 (was 30) and solved my problem.

Also I read in somewhere about using WITH NOLOCK, that solves for someones, this will speed up your sql, but I suggest to read about at Microsoft because this is not something you should use with you don't understand the concept.