Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Guides > Dashboard Users Guide > Clouds > AWS Regions > Load Balancing > Actions > Create a New Sticky Session

Create a New Sticky Session

Objective

To create a new Sticky Session policy for an AWS Elastic Load Balancer (ELB).

Table of Contents

Prerequisites

  • A created ELB and two or more front end Servers that have registered with the ELB.
  • There is an AWS-imposed limit of 20 policies per ELB.
  • Load Balancer protocol set to either HTTP or HTTPS

Background

By default, AWS ELB distributes requests to Instances running your application based on the lowest load.  However, you can create a Sticky Session so that a request is bound to the same Instance for the length of the entire session.  Sticky sessions are based on either load balancer or application generated HTTP cookies.   This tutorial will step you through how to create a Sticky Session for your ELB.

Steps

  1. Navigate to CloudsAWS RegionLoad Balancing.
  2. Click the ELB that you want to create a Sticky Session for.
  3. Expand the Listener(s) tab.
  4. Select either Load Balancer Generated Cookie Stickiness or Application Generated Cookie Stickiness to determine the basis for stickiness and set the following parameters:
  • For Load Balancer Generated Cookie Stickiness, set the Expiration Period (in seconds), after which stickiness will be disabled. Leaving this field blank means that stickiness will not expire. 
  • For Application Generated Cookie Stickiness, enter the Cookie Name. 
  1. Click Save

Stickiness.png

Additional ELB Information

The following is an excerpt from the AWS ELB Developer Guide (Sept 2010), where it speaks to the Cookie Type:

"Load Balancer-Generated HTTP Cookies

The load balancer uses a special load balancer-generated cookie to track the application instance for each request. When the load balancer receives a request, it first checks to see if this cookie is present in the request. If so, the request is sent to the application instance specified in the cookie. If there is no cookie, the load balancer chooses an application instance based on the existing load balancing algorithm. A cookie is inserted into the response for binding subsequent requests from the same user to that application instance. The policy configuration defines a cookie expiry, which establishes the duration of validity for each cookie.

For more information about the policy configuration for load balancer-generated HTTP cookies, see CreateLBCookieStickinessPolicy.

Application-Generated HTTP Cookies

The load balancer uses a special cookie to associate the session with the original server that handled the request, but follows the lifetime of the application-generated cookie corresponding to the cookie name specified in the policy configuration. The load balancer only inserts a new stickiness cookie if the application response includes a new application cookie. If the application cookie is explicitly removed or expires, the session stops being sticky until a new application cookie is issued.

For more information about the policy configuration for application-generated HTTP cookies, see CreateAppCookieStickinessPolicy.

Post Tutorial Steps

Disable a Sticky Session

  • Navigate to the Load Balancer
  • Expand the Listener(s) tab.
  • Select Disable Stickiness

 

Viewing 1 of 1 comments: view all
Commented out the section on testing stickiness. Process has changed quite a bit and time is constrained. Need to revisit.
Posted 17:08, 22 May 2013
Viewing 1 of 1 comments: view all
You must to post a comment.
Last modified
15:57, 22 May 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.