long delays in AcquireRequestState

Greylander picture Greylander · May 6, 2015 · Viewed 14.8k times · Source

Using performance monitoring tool "New Relic" I am seeing occasional (but too many) long delays in the "AcquireRequestState". I am talking about 10, 20 second delays, sometimes minutes.

I know we have not written our own event handlers for this event.

Where do I even begin looking for the cause of these delays? The little information I have found so far on msdn has not been helpful.

Answer

Jon Schneider picture Jon Schneider · Jun 3, 2016

My team saw this "AcquireRequestState" delay reported by NewRelic earlier today when one of our ASP.NET applications was having performance problems on a particular page.

The root cause turned out to be a change to a stored procedure that we'd recently deployed to our SQL Server database, which was inadvertently causing that stored procedure to take a very long time to execute. The stored procedure was called as a part of displaying the page that was having the performance issue.

We were able to resolve the issue by identifying and fixing the performance problem with the stored procedure. The "AcquireRequestState" issue from NewRelic turned out to be irrelevant; it was a symptom of the problem, rather than the cause.

This was on an ASP.NET 4.5 application running on Windows Server 2008.

tl;dr: The "AcquireRequestState" delay reported by NewRelic may be a side effect of some other problem that's causing one or more of the pages and/or AJAX requests in your ASP.NET app to take a long time to load.