Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is System.Web.Mvc.MvcHandler.ProcessAsyncRequest()?

I'm doing some tracing in NewRelic, and I'm seeing almost every single request contains a call to 'System.Web.Mvc.MvcHandler.ProcessAsyncRequest()'.

This function call can take anywhere from 300ms up to 100s (seriously, 100s). I tried to search msdn documentation, but there's nothing on http://msdn.microsoft.com/en-us/library/system.web.mvc.mvchandler.aspx

clearly, something is lying to me here.

I have a few theories as to why this is taking so long:

  • type inference? I'm using structuremap.

  • server resource issues?

  • .net version incompatibility of some sort?

  • asp.net mvc incomopatibility of some sort?

Environment:

.net 4

asp.net mvc 3

dedicated vm

like image 266
Oren Mazor Avatar asked Nov 29 '11 00:11

Oren Mazor


1 Answers

When I found this issue, I thought the same as @garfbradaz and looked through the MVC source. It was interesting, as I found no reference to the ProcessAsyncRequest method.

Hence, I decided it might be something New Relic were injecting, or as you say, a red herring and something is lying to us! I switched New Relic off, and got in touch with their support team.

Today, after a few emails from an extremely responsive and courteous member of the New Relic team, they got back to me and confirmed it's a bug (of sorts). Here is their response:

ProcessAsyncRequest is a custom name that we use for any metric being recorded that is not / does not inherit from "System.Web.UI.Page." Given that MVC view engine uses "System.Web.Mvc.ViewPage" all of those metrics will incorrectly fall under the New Relic moniker of "ProcessAsyncRequest."

I will be working on a modification to the agent and the core instrumentation that will hopefully aggregate these metrics appropriately. I am sorry for the confusion and trouble this has caused you.

I'll give you an update as I get close to a solution.

EDIT: Further response from New Relic below - looks like they have a fix in place.

I just pushed a commit that will help us better classify the transactions coming from the installed agent.

As far as the performance issue we did discover an issue reported by the awesome engineers at AppHarbor that was causing TypeLoadExceptions which might be related to slow loading / compiling code being put into the cache. We have found the cause and are in the final testing phases of that fix and we are hoping to get the fix in the next release of the agent.

Nick from New Relic was excellent in responding to this and their product has been really useful, so I don't have any bad feelings, just thought I'd share the details here.

Very happy to find out there are no ghosts in my MVC app anyway!

For now my advice to anyone having these problems is switch off New Relic until their next release.

EDIT 2: Nick from New Relic emailed me today - their latest agent (version 2.0.9.15) - is now available and should fix this issue.

like image 134
dazbradbury Avatar answered Oct 20 '22 03:10

dazbradbury