Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

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.
 
Share this answer
 
Comments
Rahul Rajat Singh 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900