One of the most common issues that users face when hosting their application in a webfarm is “unexpected loss of session state”. We face these issues when we store the session information inproc, especially when we don’t set client affinity in the load balancer level.
This is one of the main reasons why users opt for an outproc session storage technique (like a SQL server or State Server). But, when you are configuring a state server across a web farm, maintaining the session state across multiple servers and applications is a matter of challenge for which you must take care of a little configuration piece while setting your sites.
Let me give you a brief idea on what we can do and why we are supposed to concentrate on such configuration settings while setting up our sites in a webfarm environment.
For example, the value looks like: ’13clw2vlrjio0d45opi0qg4500000002’ where 2 is site id
You should ensure that your website is associated with the same site ID in all the web servers which are behind a load balancer to avoid unexpected session state losses.When we are configuring the application in multiple servers and when the site ID’s are different in different servers, this primary key will become different for different servers. That will produce a behavior similar to storing the session inproc.
Conclusion:
Maintaining same site ID for the same application across all the servers in the webfarm is important and will help in maintaining the session state when going with out-of-proc approach in a multi-server environment
Please leave your comments if you have any questions around this or need any clarification.
Author: Nikita Habib
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.