0

Would like to know the real benefit/advantage of configuring sticky sessions @ load balancer level in AWS..

i understood from the AWS documentation that the user request will be routed to a specific instance based on the cookie added to the request by ELB(Elastic load balancer)

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-sticky-sessions.html#enable-sticky-sessions-duration

But not able understand the real benefit of using this feature..Please help!!!

1 Answer 1

2

I'll give an example to illustrate their utility.

PHP, by default, stores session data in a file on the server. If you have two servers behind an ELB and no sticky sessions, the user's session data will be lost/inconsistent as they bounce between the two servers at random.

There are workarounds for this - storing session data in a database or caching layer, for example - but for some applications (particularly legacy ones you have little control over) it's a lot easier to just use the stickiness option.

7
  • actually we deployed Java rest api in AWS and we recieve huge number of client requests to this api...would like to know if this feature is beneficial to us???
    – shiv455
    Jan 6, 2016 at 16:08
  • 1
    @shiv455 That's not a question we can answer for you. If you're already receiving lots of requests without errors, there's no reason to turn on sticky sessions. They're a workaround, but not a best practice.
    – ceejayoz
    Jan 6, 2016 at 16:29
  • 2
    a good practice is to avoid stickiness on AWS as long as possible, and keep session state in database or cache if you want to properly leverage autoscaling and load balancing
    – Tom
    Jan 6, 2016 at 16:34
  • ok i thought it is a best practice to follow as it was mentioned in aws.amazon.com/articles/1636185810492479
    – shiv455
    Jan 6, 2016 at 16:53
  • 1
    @shiv455 if your API is stateless then my guess is you do not need sticky sessions - if you don't need it don't use it! Jan 6, 2016 at 19:57

You must log in to answer this question.

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