Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Requests hanging on Session module on IIS 7.5

Tags:

From time to time, some requests on my website starts to hang on the RequestAcquireState state of the Session module. When that spiral begins all requests timeout and we need to restart the IIS on the affected server.

I investigated it a lot and the only conclusion I got is that somehow a deadlock is happening while the application tries to access user data stored in Session.

The only option I can think of to fix this issue is to either reduce or stop using Sessions in my application. This is definetely part of the plan, but it will take a while before we can complete that.

We run 6 machines with IIS 7.5, out of proc StateServer and server affinity on in our Load Balance.

Any hints on how to workaround this issue or fix it at all without having to remove Sessions entirely?

IIS Hanging Processes

like image 620
tucaz Avatar asked May 15 '13 16:05

tucaz


People also ask

Why is IIS website so slow?

An IIS or ASP.NET hang can cause your website to have slow page loads, timeouts, or 503 Service Unavailable errors. Hangs can be caused by blocked ASP.NET threads, bad configuration, or request queueing.

Where is session timeout set in IIS?

1. Within IIS Manager select the WebAccess virtual directory from the tree. 4. On the State Management tab of the ASP.NET Configuration Settings dialog modify the Session timeout (minutes) setting to suit (the default is 20) and press OK.

How do I enable session state in IIS?

To enable in-process session state by using the UIOpen IIS Manager and navigate to the level you want to manage. In Features View, double-click Session State. On the Session State page, in the Session State Mode Settings area, click In process.


1 Answers

Lock mechanism exist on both provider and session module (IIS Session Module). You can develop custom session module, but you still need provider without locking or You can develop custom provider without locking but you still need IIS session module and it is not so simple to implement at that level.

The Solution is UnlockedStateProvider [aka Unlocked]

Follow the white rabbit :P (Check the demo project, it explains everything.)

like image 54
efaruk Avatar answered Oct 07 '22 16:10

efaruk