How can I view the number of pooled ADO.NET database connections in an Azure App Service?
Asked Answered
G

1

6

I am having problems with the number of pooled connections in my Azure web app. And it will help me a lot if I can see the number of pooled connections so I can understand how it relates to the application usage.

On classic Windows machines I can view the ADO.NET performance counter "NumberOfPooledConnections" using the "Performance Monitor" tool. But I could not figure out how to do the same thing when I am using an Azure App Service.

Gardell answered 18/5, 2017 at 2:2 Comment(3)
Pooled connections are visible from the database side, so if the database is SQL server for example, you can use simple commands like sp_who (you can use the Application Name key in the connection string to ease filtering)Station
@Simon Mourier This is not possible in my case because the web application is a multi-tenant application that connects to multiple databases. So I need to see the total number of connections to all databases. Your solution will only give me the number of connections to 1 database.Gardell
well, you can still use database commands like sp_who to determine the number of connections to all databases.Station
M
1

Unfortunately, performance counters are not supported on Azure App Services due its multitenant nature of it.

See: Access performance counter programmatically in Microsoft Azure web app

Three things that you may want to try however is:

  1. Enable Application Insights (https://learn.microsoft.com/en-us/azure/application-insights/app-insights-performance-counters) or New Relic.

  2. If your application is for test purpose, I can also suggest to deploy to cloudservice where you will have access to the full VM and traditional Perf counter

  3. Try deploying to App Service Environments & I believe you will get access thru programmatically at least. This does get expensive.
Memorial answered 22/5, 2017 at 18:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.