0
votes

I have googled and see in many articles saying that when using more than one worker process there is a small issue related to the session handler of asp.net. I am new in web programming, and I do not understand it... Could someone explain it in an easy understandable way?

I have deployed an asp.net mvc application on IIS. In order to use it, user is required to log in, also once logged in, there are places where user is required to log in again (Yes, I know, using SSO no need to log in again but it is not implemented yet). So taking into account this, if I set more than one worker process for the application pool, what can happen? It is going to stop working? This is what most articles is referring when talking about session handler?

1

1 Answers

0
votes

You probably don't want to turn on WebGardening (Multiple Worker Processes), often times it causes more harm than good, especially with .NET apps. By default, Session in .NET is stored "InProc" meaning In Process. If you are setting up WebGarden (Multiple Proc on one Box) or WebFarm (Multiple Servers) then you need some way to handle Session. With WebFarm, one technique used is called Sticky Sessions where the device doing the routing (Load Balancer) will route the same user to the same server each time. With WebGardens, there is no "stick session". Other techniques for handling this issue is by storing Session State Out of Process for which there are many ways to do that. Old article, but gives good treatment: https://www.codeproject.com/Articles/32545/Exploring-Session-in-ASP-Net