1

When a user comes to my site, I want him to hit one server during his browsing period. I don't want him to jump from server to server as he pages through my site.

I want his "session" to be kept to that server only.

How can I do that with load balancer?

1 Answer 1

3

Well, technically that's what round-robin is - sending each connection to a different server in sequential order.

What you're referring to is usually called persistence, or stickiness, and the EC2 load balancer can achieve this by inserting cookies into the HTTP stream. It can generate its own cookies and then check for the value on subsequent requests. So the cookie might say something like "Server 1" and the load balancer knows to send the connection back to server 1. You can also make use of existing application cookies. See: http://aws.amazon.com/about-aws/whats-new/2010/04/08/support-for-session-stickiness-in-elastic-load-balancing/

and

http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/

The drawback is that the client must have cookies enabled in their browser.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .