Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

long delays in AcquireRequestState

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.

like image 300
Greylander Avatar asked May 06 '15 03:05

Greylander


People also ask

Why is AcquireRequestState taking so long?

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.

What is AcquireRequestState?

AcquireRequestState - Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request. A valid session ID must exist.


2 Answers

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.

like image 134
Jon Schneider Avatar answered Sep 23 '22 00:09

Jon Schneider


Try to apply Hotfix Rollup 2828841 on the server.

Issue 6

Symptoms

When you send many concurrent requests that have the same SessionId to an ASP.NET 4.5 web application, some requests may freeze at the RequestAcquireState stage unexpectedly.

Resolution

After you apply the hotfix, the hotfix makes sure that the EndRequest event will always trigger.

This hotfix applies to Windows 7 Service Pack 1 (SP1), Windows Server 2008 R2 SP1, Windows Server 2008 Service Pack 2 (SP2), and Windows Vista SP2.

like image 42
Vadim Dubovitsky Avatar answered Sep 21 '22 00:09

Vadim Dubovitsky