How can i get the full, sequenced call stack of an ASP.NET request?

1.1k Views Asked by At

I'm trying to hunt down some performance issues in my ASP.NET (Nancy, OWIN/System.Web hosted) app.

Through profiling, (namely Stackify tools), i've noticed some 'gaps' at the end of certain requests, that aren't non-obvious calls (e.g not Database, HTTP, Redis, etc).

Here's an example: (taken from Stackify's Prefix tool) enter image description here

Summary:

  1. Request took 1289ms
  2. 'Most' (hot path) was taken by a SQL query. (i'm fine with this for now, could be optimized but is not the focus of this question)
  3. Couple of 'Untracked Application Code' gaps, taking over 500ms.

Particulary, the last gap (340ms) i've seen a lot and is the focus of my investigations.

Prefix allows custom code configuration that allows to get more info on these 'gaps' by whitelisting an assembly, but the problem is i don't know which assembly this time is being spent. My gut feeling is Nancy/OWIN/some dependency injection lib, etc. (i've tried whitelisting all of these, to no avail). I just know it's not my immediate code in this URL.

So my questions are:

  1. Any ideas on how i can find out the full and ordered call stack of this request, to then use as whitelisting for Prefix? Tools i can use?
  2. Any 'left of centre' ideas on how to track down this gap? Another tool instead of Prefix that tells me where time is spent?

Thanks!

1

There are 1 best solutions below

0
On

You can set up custom .Net code profiling, both for Prefix and for Retrace, by creating a JSON file containing the classes and methods that should be profiled in JSON format (wildcard characters are allowed).

See this article https://dzone.com/articles/troubleshooting-percona-monitoring-and-management

As well as https://support.stackify.com/custom-profiling-configure-for-net/