M
matthew_glen_evans
Hi,
I have inherited some legacy code with performance issues:
I ran perfmon on the problematic use case, with a counter on .NET CLR
Data / Current # Pooled connections (amongst others)
I noticed that while performing a set of tasks in the use case, pooled
connections increased systematically peaking at 9. I think this is
because of the workload governor which MSDE uses, but I think that this
would simply carry on increasing on a full instance of SQL Server.
I am unsure why this is happening: my question is this: given a
non-threaded single-user environment, why would the current pooled
connections increase in this way.
I have not yet tried to debug the entire process, but on the face of
it, all data access is mediated through a data access layer, in which
all method calls dutifully close connections which they open in a
finally block.
I would have expected the same connection to be iteratively re-used,
but it seems like connections are being leaked...
My expectation in a full user environment is that the pool would run
out of connections and begin to throw "Timeout in obtaining a
connection from the pool" exceptions:
i.e.
System.InvalidOperationException: Timeout expired. The timeout period
elapsed prior to obtaining a connection from the pool. This may have
occurred because all pooled connections were in use and max pool size
was reached.
Typically what does happen is that the server starts to become slow and
generates System.Data.SqlClient.SqlException Timout Expired.The timeout
period elapsed prior to completion of the operation or the server is
not responding
Could they be related? Any thoughts on why the connections are not
being released?
TIA,
Matthew
I have inherited some legacy code with performance issues:
I ran perfmon on the problematic use case, with a counter on .NET CLR
Data / Current # Pooled connections (amongst others)
I noticed that while performing a set of tasks in the use case, pooled
connections increased systematically peaking at 9. I think this is
because of the workload governor which MSDE uses, but I think that this
would simply carry on increasing on a full instance of SQL Server.
I am unsure why this is happening: my question is this: given a
non-threaded single-user environment, why would the current pooled
connections increase in this way.
I have not yet tried to debug the entire process, but on the face of
it, all data access is mediated through a data access layer, in which
all method calls dutifully close connections which they open in a
finally block.
I would have expected the same connection to be iteratively re-used,
but it seems like connections are being leaked...
My expectation in a full user environment is that the pool would run
out of connections and begin to throw "Timeout in obtaining a
connection from the pool" exceptions:
i.e.
System.InvalidOperationException: Timeout expired. The timeout period
elapsed prior to obtaining a connection from the pool. This may have
occurred because all pooled connections were in use and max pool size
was reached.
Typically what does happen is that the server starts to become slow and
generates System.Data.SqlClient.SqlException Timout Expired.The timeout
period elapsed prior to completion of the operation or the server is
not responding
Could they be related? Any thoughts on why the connections are not
being released?
TIA,
Matthew