Load balanced IIS Servers with ASP.NET InProc Session

8,009

Solution 1

If you are using the NLB clustering that ships as part of windows server 2003 then you are looking for the affinty setting. If you set this to "single affinty" then communication from one IP address will always route to the same server, thus allowing the client to get access to the InProc session state. There is some documentation on how to set it at http://technet.microsoft.com/en-us/library/bb734858.aspx

Solution 2

It could be achieved depending on how you are balancing.

A lot of balancers will allow you to nominate a cookie as their method for deciding where to direct stick sessions, but it's very dependent on the hardware/software balancer you're using. That's the only way it's going to work for you.

Solution 3

I can't say that I have ever load balanced an IIS 6 server with InProc sessions without using a load balancing device. If you can't use some kind of distributed cache, such as SQL Server or a more performant custom cache, you will probably need to set up some kind of "sticky session" routing in a load balancing device. This allows you to farm out your web sites, but for each user, for the duration of their session, they are repeatedly routed to the same particular server in the farm. This allows you to use InProc sessions, but at the relatively minor cost of not having perfectly ideal load balancing.

Note: You might get better answers for this kind of question over on StackOverflow's sister site: www.ServerFault.com.

Share:
8,009

Related videos on Youtube

chugh97
Author by

chugh97

Updated on September 17, 2022

Comments

  • chugh97
    chugh97 over 1 year

    Has anyone configured IIS 6.0 loadbalancing on win 2003 servers with ASP.NET app using InProc Sessions. How can this be achieved?

  • shreddd
    shreddd almost 15 years
    Do you have any tips about where I can read about "some kind of distrubuted cache"? =)
  • shreddd
    shreddd almost 15 years
  • Jeremy Davidson
    Jeremy Davidson almost 15 years
    Not true, you can use InProc sessions provided that the load balancer uses cookies or source IP address to always send the same user to the same server. (However if a server falls over then the session data is lost.)