Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The request queue limit of the session is exceeded

I have this error in ASP.NET application , NET 4.7.1.

The request queue limit of the session is exceeded.

Full:

System.Web.HttpException (0x80004005): The request queue limit of the session is exceeded.
at System.Web.SessionState.SessionStateModule.QueueRef()
at System.Web.SessionState.SessionStateModule.PollLockedSession()
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)

any suggestions ?

like image 492
Kiquenet Avatar asked Jan 27 '20 20:01

Kiquenet


2 Answers

The default behavior has changed in .NET 4.7. Retargeting guide suggests:

To restore the old behavior, you can add the following setting to your web.config file to opt-out of the new behavior.

<appSettings>
  <add key="aspnet:RequestQueueLimitPerSession" value="2147483647"/>
</appSettings>

Clarification of changed behavior:

In the .NET Framework 4.6.2 and earlier, ASP.NET executes requests with the same Sessionid sequentially and ASP.NET always issues the Sessionid through cookies by default. If a page takes a long time to respond, it will significantly degrade server performance just by pressing F5 on the browser. In the fix, we added a counter to track the queued requests and terminate the requests when they exceed a specified limit. The default value is 50. If the limit is reached, a warning will be logged in the event log, and an HTTP 500 response may be recorded in the IIS log.

Also addressed here: https://knowledgebase.progress.com/articles/Article/The-request-queue-limit-of-the-session-is-exceeded-in-sitefinity-11-2

like image 75
Mart Wienk Avatar answered Oct 10 '22 14:10

Mart Wienk


Some time this error is generated by to many redirects on server side, after investigation I detect that in the fact user is redirected to same action by ActionsFilter after I fixed this error has not occurred, I think if you investigate IIS logs you are more likely to find the same problem.

PS. For this case setting RequestQueueLimitPerSession will not solve the problem.

TO REPRODUCE: Open IE 11 open the specified path and press F5 for 60 sec. It will generate a lot of requests to this path and if we'll take a look to iis then we will find some requests with win-32 status = 64 enter image description here

Quite analyzing of IIS logs will give you a lot of information about nature of this requests/user agent/all accessed paths/request status/...

like image 22
BASKA Avatar answered Oct 10 '22 14:10

BASKA