Requests hanging on Session module on IIS 7.5

tucaz picture tucaz · May 15, 2013 · Viewed 21.7k times · Source

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

Answer

efaruk picture efaruk · Dec 15, 2014

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.)