views:

83

answers:

2

Is it possible (from a asp.net application) to check how many connections of the ADO.NET connection pool are currently in-use and how many are available (not currently in-use)?

A: 

How many are available is all down to the "Max Pool Size" setting in the connection string (For SqlClient at least that is)

See http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

Not sure from code how to tell how many physical connections to the server are open, you may need to use something from the server side to check that. (E.g. Activity Monitor from Sql Management studio)

MikeG
+1  A: 

You have tried with Performance Counters?

http://msdn.microsoft.com/en-us/library/ms254503.aspx

NumberOfActiveConnections: The number of active connections that are currently in use. NumberOfFreeConnections: The number of connections available for use in the connection pools.