• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Load balancing and session states

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys, I'm trying to understand how a web server manages user sessions in a clustered environment. Regarding this, my questions are:

1) How would a load balancer manage web server user sessions in a clustered environment?

2) Would HTTPS be treated differently to HTTP?

Your thoughts are much appreciated.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've used Cisco CSS 15001 and it had two modes for maintaining server affinity:

A) via Cokies - load-balancer adds is own cookie to served content
B) via IP ranges - admin has to manually define IPs of clients served by each server in a cluster.

Method A doesn't work if load-balancer uses HTTPS to connect to the servers.

If load-balancer is equipped with encryption module it is possible to use method A with HTTPS. Load-balancer uses HTTP to connect to servers, adds cookie and then sends content to a client via HTTPS. This way servers don't waste CPU for HTTPS handling.

Method B doesn't support automatic failover.

Jacek
[ April 30, 2007: Message edited by: Jacek Ostrowski ]
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jacek,

Interesting and important points, thank for sharing! But I'm still a bit curious about session management.

For example, if the user adds an item to his shopping cart (on a new session) consider that at latter time he/she adds another item. [1] In this case, what's the behavior on a clustered environment? Would the user be forced to maintain a conversation to that web server who served him/her the first time in order to have access to the session? [2] And in this case, what roles does the load-balancer play? [3] Would HTTP or HTTPS behave differently in this scenario?

Your thoughts on this matter are much appreciated.

Regards,
Filipe
 
Jacek Ostrowski
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Filipe,

If load-balancer uses predefined IP ranges (I think that this is called sticky IP) to maintain server affinity then all request from given client goes always to same server. So from client's perspective there is only one server in a cluster. No problem with sessions here. Works regardless of used protocol.

If load-balancer uses cookies, then for first request it chooses server for a client, forwards request to chosen server and adds to response his own cookie with server ip (or anything that could be used to find this server). On following requests load-balancer finds its own cookie, then it forwards requests to server based on info from the cookie. This works only with HTTP.

All this is far beyond requirements for SCEA part 1. For exam you need to know that load-balancer needs to maintain client sessions.

Jacek
 
Philip Pomario
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Everything makes more sense now. Thanks, Jacek!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic