Search code examples
asp.netasp.net-mvcasp.net-web-apinewrelic

Slow Transactions - WebTransaction taking the hit. What does this mean?


Trying to work out why some of my application servers have creeped up over 1s response times using newrelic. We're using WebApi 2.0 and MVC5.

As you can see below the bulk of the time is spent under 'WebTransaction'. The throughput figures aren't particularly high - what could be causing this, and what are the steps I can take to reduce it down?

Thanks

Taken from newrelic.com

EDIT I added transactional tracing to this function to get some further analysis - see below:

enter image description here

Over 1 second waiting in System.Web.HttpApplication.BeginRequest(). Any insight into this would be appreciated.


Solution

  • Ok - I have now solved the issue.

    Cause

    One of my logging handlers which syncs it's data to cloud storage was initializing every time it was instantiated, which also involved a call to Azure table storage. As it was passed into the controller in question, every call to the API resulted in this instantiate. It was a blocking call, so it added ~1s to every call. Once i configured this initialization to be server life-cycle wide,

    Observations

    As the blocking call was made at the time of the Controller being build (due to Unity resolving the dependancies at this point) New Relic reports this as

    System.Web.HttpApplication.BeginRequest()

    Although I would love to see this a little granular, as we can see from the transactional trace above it was in fact the 7 calls to table storage (still not quite sure why it was 7) that led me down this path.

    Nice tool - my new relic subscription is starting to pay for itself.