4
Reply

How do you load balance and handle sessions?

Sunil Kurian

Sunil Kurian

18y
5.9k
0
Reply

    In typical scenarios wherein you have the web farm set up containing multiple web front end servers - the session management becomes an important aspect for the application, of course if you are using it.The better approach for session management is such scenario is not to use the InProc mode and choose between session state or SqlServer mode. Here is why?When you set the session state mode to InProc, all user sessions are kept in the worker process of the application i.e. w3wp.exe. One might ask so what's wrong in it? A. If user base of your application is huge, then you will end up loading your web server which indeed is doing web request executions as well as session management. B. Sessions might be lost if the request is firstly served by Server A and second request of same user is served by Server B which will be fresh request of Server B.Making use of State server or Sql Server not only avoids above mentioned issues but also helps in releasing extra load on your web front end server.

    In typical scenarios wherein you have the web farm set up containing multiple web front end servers - the session management becomes an important aspect for the application, of course if you are using it.The better approach for session management is such scenario is not to use the InProc mode and choose between session state or SqlServer mode. Here is why?When you set the session state mode to InProc, all user sessions are kept in the worker process of the application i.e. w3wp.exe. One might ask so what's wrong in it? A. If user base of your application is huge, then you will end up loading your web server which indeed is doing web request executions as well as session management. B. Sessions might be lost if the request is firstly served by Server A and second request of same user is served by Server B which will be fresh request of Server B.Making use of State server or Sql Server not only avoids above mentioned issues but also helps in releasing extra load on your web front end server.

    Use SQLServer for session state.