Load timeout string SQL string

It seems that if there is an sql memory leak somewhere and you don't have time to find it, you can use the load balance timeout parameter in the sql connection string to crash the connection after x seconds.

I agree that I can set the load balance time to 30-40 seconds and then look for the leak of the latter, while the leak won't affect my application much.

+2


a source to share


2 answers


No. The load balance timeout is the minimum time that a connection will live in the pool, this will not limit the lifetime of connections.



You may be looking for a Lifetime setting that will cause connections to close when they are too old when they come back to the pool, but that won't help you either, since the problem is that connections aren't coming back to the pool in the first place.

+1


a source


(Would add as a comment to Guffa, but my rep is not high enough)

You are almost correct about Time Balance Time Time behavior, at least for .NET 3.5+ and probably earlier. When receiving a connection from the pool, it kills all that were open within the specified number of seconds. Natural use is of course for load balancing. Here's an ambiguous doco for .NET 3.5 with an explanation of the comments at the bottom:

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring%28v=vs.90%29.aspx



And here is the MS guy from 2004 says the same thing:

http://blogs.msdn.com/b/angelsb/archive/2004/09/20/231963.aspx

EDIT: I just realized that this option would not help the described case, because the connections are destroyed only when they are fetched from the pool. Leaked connections are never retrieved from the pool again, as "leak" means they never return to the pool.

+1


a source







All Articles