Enable web application for load balancing RRS feed

  • Question

  • User-510697852 posted

    We have web application developed in Visual Studio 2015 using c# and .net framework 4.0. We want to deploy on client's production server but client have 2 servers for load balancing. I have neither handled this situation not much familiar with load balancing. How to make web application enable for load balancing?

    Thursday, March 1, 2018 9:15 AM

All replies

  • User541108374 posted


    if you're using session or caching in your application make sure that you take it out of process (SQL Server, Redis, cache services).

    If they have sticky sessions configured it would land on each request on the same server hence you would not have to do the former step.

    Also check the configuration for machineKey and make it the same on both machines.


    Thursday, March 1, 2018 9:33 AM
  • User283571144 posted

    Hi hardeshis,

    According to your description, I suggest you could follow below point:

    1.Manage State

    By default, ASP.NET stores session information in the server memory. This configuration is known as in process.

    In multi-server architectures, a single user’s request can be sent to a different server. A user may start a session at one server, but later requests are sent to a different in-process server.

    One way is enable client affinity feature.

    Details, you could refer to below article.


    Another way is use ASP.NET State Server service, and Microsoft SQL Server to share the session state.

    2.Synchronize Configuration and Content

    A Web site’s security, performance, and many other aspects of its behavior are defined by the configuration of the Web server. Multi-server sites must have the configuration synchronized between all the servers to provide a consistent experience to users whose requests are sent to different Web servers. ASP.NET makes it simple to synchronize configuration between multiple servers because all configuration information is stored in the virtual server’s path as XML files. These files have a .config file name extension.

    More details, you could refer to below article.


    Best Regards,


    Friday, March 2, 2018 6:10 AM