30 Apr 2021 11:42 AM - last edited on 16 Nov 2021 10:18 AM by MaciejNeumann
After installing MSSQL extension we've discovered that, some requests coming from IIS are opening multiple connections, but not closing. We've confirmed this after seeing multiple "sleeping" processes that keeps piling up in the DB.
We're trying to find out all the requests that opens more than 10 connections, such as shown in the screenshot.
I tried doing this from Diagnostic tools, but could not find anything helpful. Do we have any functionality to accomplish this? Maybe even via API?
Solved! Go to Solution.
04 May 2021 01:26 AM
Hi Serhat,
You may want to review this section of Dynatrace Help on some use cases of request attributes:
https://www.dynatrace.com/support/help/shortlink/request-attributes#how-to-make-use-of-request-attri...
I'd say you'd want to create a request attribute that counts the number of occurrences of that method. Then, you could use that as the basis for a custom error. You could also create a calculated service metric and access those results via the REST API.
04 May 2021 09:52 AM
Well, that's actually a good idea. I tried going with it for both Custom Attributes and Custom Service, the problem is that, the method is not instrumentable due to safety reasons. Can we override it?
05 May 2021 01:14 AM
That's probably because Dynatrace reserves that method for capturing database insights and statement details.
Is it possible to wrap the method in another in your code that could then be counted? I know it's not ideal, but I couldn't really see another way, except maybe creating a custom service.
05 May 2021 08:22 AM
We've also spoken to Dynatrace sales engineer at the parallel to clarify the situation. He mentioned that, in AppMon lots of customers tried using Open() as entry point and broke their systems, so this was some kind of counter measure.
He gave us some alternative solution instead of what we're trying to do. Maybe we can find the problematic requests from the DB side.
https://sqlperformance.com/2017/07/sql-performance/find-database-connection-leaks
I've also find out that IIS has an API. I can do some queries about app pools and worker processes, then push the relevant numbers as a metric. I've notified the developers, we'll see how they prefer to proceed.
https://docs.microsoft.com/en-us/iis-administration/api/application-pools