• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. User Guide
  4. FAQs
  5. What Is the Relationship Between the Load Balancing Algorithms and Sticky Session Types?

What Is the Relationship Between the Load Balancing Algorithms and Sticky Session Types?

The sticky session feature ensures that requests from the same user are forwarded to the same backend server. Three types of sticky sessions are available. Table 2 and Table 1 list the relationships between load balancing algorithms and sticky session types.

Table 1 Session stickiness of enhanced load balancers

Load Balancing Algorithm

Sticky Session Type

Layer 4 (TCP)

Layer 7 (HTTP/HTTPS)

Weighted round robin

Source IP address

Supported

Not supported

HTTP cookie

N/A

Supported

App cookie

N/A

Supported

Weighted least connections

Source IP address

Not supported

Not supported

HTTP cookie

N/A

Not supported

App cookie

N/A

Not supported

Source IP hash

Source IP address

Supported

Supported

HTTP cookie

N/A

Not supported

App cookie

N/A

Not supported

Table 2 Session stickiness of classic load balancers

Load Balancing Algorithm

Sticky Session Type

Layer 4 (TCP/UDP)

Layer 7 (HTTP/HTTPS)

Round robin

Source IP address

Supported

Not supported

HTTP cookie

N/A

Supported

App cookie

N/A

Not supported

Least connections

Source IP address

Supported

Not supported

HTTP cookie

N/A

Not supported

App cookie

N/A

Not supported

Source IP hash

Source IP address

Supported

Supported

HTTP cookie

N/A

Not supported

App cookie

N/A

Not supported

Generally, the round robin algorithm is recommended. Layer-4 sticky sessions use source IP addresses, and layer-7 sticky sessions use HTTP cookies.