Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Variables on Clustered Servers 1

Status
Not open for further replies.

towser

Programmer
Feb 19, 2001
29
GB
My company have decided to implement it's own Web Servers and host our own sites, where before we would use an external company.

They have implemented clustered 3 tier servers.

This caused the alarm bells to ring as I have found articles stating that session variables do not work in this enviroment. This would be a problem as most of our ASP applications use Session variables to pass data from screen to screen. We have always used Session variables because they worked fine and basically we knew no other way apart from using hidden form fields.

Has anyone got any experience of this problem and solutions to it ?

cheers
 
If you're using clustered servers as a way to get redundancy, then you won't have a problem. If the primary server goes down, your users get disconnected, but the secondary server should be up within 30 seconds. The users can then re-login and try again. (while you frantically repair the primary server)

But if you're talking about multiple servers to provide additional capacity (not redunancy), then you're in a "web farm" situation, and you shouldn't use session variables as they're tied to a particular server. When the user clicks on something in your app, that request could go to any one of the servers in the farm (you have no control over it). So, if you've got 5 servers, then they have a 20% chance of hitting the server they were just on. The other 80% chance is they'll be on one of the other servers.

It's true that some of the high-end load balancers (F5 BigIP, etc) claim to manage session variables, but it's been the experience at my new company that they're "Not There" yet. Plus, they ain't cheap ($50k+ for a BigIP).

To get around your session-variable problem, you can do three things:
1) Change the hardware arrangement so certain customers go to certain servers (thus limiting the size of customers you can serve to the size of one Intel server)

2) Change the architecture so that you store a SessionID in a temporary cookie, and store the user's session info in the database keyed off that cookie. (this gets my vote)

3) Something else that I don't know about. :)

Sorry to give you bad news, but I hope this helps some.

Chip H.
 
Cheers Chip H.

We are using a Web Farm and after spending all day yesterday searching the internet and reading endless documentation you are spot on, Session Variables are no good.

But all might not be lost because there may be a way of actually setting up some load balancing on the servers so a users session remains on the first server they hit when entering the site.

Thanks Anyway

Towser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top