Click here to Skip to main content
11,505,486 members (70,521 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
OK before asking the real question, I will give a brief overview. There was a site which was running on a single web server. This site was using in-proc session for keeping track of some important information(very crucial).

After a couple of years the website was getting a lot of traffic(around a couple of millions per day) and all these hits are actually doing some DB operations on the site. So to keep the performance the single server was replaced by a server farm. Now there are 5 servers sitting behind a load-balancer.

Now the problem: Earlier when only one server was being used all the session handing was in-proc. Now in the server farm scenario, we cant expect it to work properly. We will have to have SqlServer or stateSercer in place. The problem in doing this is that there are lots and lots of classes, collections and generics being pushed into the session. If we want to use any of the above two we will have to make everything put in session serialize-able(which would mean a lot of rework and most importantly it will take time).

Now I was thinking that till these session objects are getting changed(to become serializable), I will do something at the load-balancer to redirect requests coming from an IP to the same server always so that the in-proc session will keep working for the time being. i.e. load balancer will keep a map like [requesting IP - web server]

The question here is, Am i going in the right direction or there are some problems I could not foresee? Is there any other way I could have things working with in-proc session for a couple of months(having something done on load-balancer)

Experts, please suggest. Shall I go with this IP-server mapping or is there any other way this could be done more elegantly?
Posted 27-Apr-12 21:03pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi
Regarding : "The question here is, Am i going in the right direction or there are some problems I could not foresee? "

You should read up on server affinity and sticky sessions
If the load balancer uses session affinity it will associate all requests from a IP address to a single server in the farm, this will take care of it for you i.e. the server serves all requests for that session.
  Permalink  
Comments
Rahul Rajat Singh at 1-May-12 3:47am
   
This is perhaps the most useful advise anyone gave me in days. I will definitely look into it.

+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 1,067
1 Maciej Los 575
2 Peter Leow 540
3 F-ES Sitecore 525
4 DamithSL 470


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 1 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100