Professional Documents
Culture Documents
Elastic Load Balancing Deep Dive: Narayan Subramaniam and David Pessis
Elastic Load Balancing Deep Dive: Narayan Subramaniam and David Pessis
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Elastic Load Balancing automatically distributes
incoming application traffic across multiple targets,
such as Amazon EC2 instances, containers, and IP
addresses.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The Elastic Load Balancing Family
Application Load Balancer Network Load Balancer Classic Load Balancer
Previous Generation
HTTP & HTTPS (VPC) TCP Workloads (VPC)
for HTTP, HTTPS, TCP
(Classic Network)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Elastic Secure Integrated Cost Effective
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architecture
ELB VPC Customer VPC
us-west-1a
EC2
ELB Instance
Amazon
Route 53
us-west-1b
EC2
ELB
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer
Advanced request routing with support for
microservices and container-based applications.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer
New, feature rich, layer 7 load-balanced
platform
Listener Listener
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Listeners
Define the port and protocol which the load
balancer must listen on
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load Balancer
Listener Listener
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Target groups
Logical grouping of targets behind the load
balancer
Listener Listener
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Targets
Support for EC2 instances and ECS containers,
and IP Addresses.
Listener Listener
Rule (default) Rule (*/img/*) Rule (default)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Rules
Each listener can have one or more rules for
routing requests to target groups.
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
orders.example.com Instance
EC2
ELB
Instance
EC2
Instance
Running two separate
services with Classic
Load Balancer
EC2
Instance
EC2
ELB
Instance
EC2
images.example.com Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
Instance
EC2
Instance
/orders
EC2
Instance
Application Load
Balancer allows for
ELB multiple services to be
example.com hosted behind a single
EC2
Instance
load balancer
/images
EC2
Instance
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto Scaling integration
Auto Scaling can now scale targets within a
target group
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECS integration
Application Load Balancer (ALB) is fully
integrated with Amazon EC2 Container Service
(Amazon ECS), managing target groups, paths,
and targets
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
Instance
EC2
Instance
/api
EC2
Instance
Application Load
Balancer allows
ELB containers to be
example.com included in the target
ECS
Container group
/test
ECS
Container
ECS
Container
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Health checks allow for
traffic to be shifted away
from failed instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Health checks
EC2
Instance
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Health checks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Health checks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Host-based Routing
Route based on host field in the HTTP header
ELBSecurityPolicy-TLS-1-2-2017-01 – Strictly
supports TLS1.2
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Native IPv6 support
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer with WAF
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IP as a Target
Use any IPv4 address from the load
balancer’s VPC CIDR for targets within load
balancer’s VPC
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cross-zone load balancing
Requests distributed evenly across multiple Availability Zones
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Access logs
Provide detailed information on each
request processed by the load balancer
With the Application Load Balancer, you only pay for what you use. You are
charged for each hour or partial hour your Application load balancer is running
and the number of Load Balancer Capacity Units (LCU) used per hour
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load balancer capacity units
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Migrating to Application Load Balancer
Publishing LCU Metrics for Classic Load Balancer which Allows customers
to estimate pricing if they migrate from Classic to ALB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Network Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Network Load Balancer
New, layer 4 load-balancing platform
Connection-based load balancing
TCP protocol
High Performance
Can handle millions of requests per sec
Static IP Support
Preserves Source IP
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Static IP
Automatically gets assigned a single IP per
Availability Zone
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Assign Elastic IP Addresses
TargetGroup 1
1a
34.214.45.162
EC2 Instances
EC2 Instance
Assigning Elastic IP
provides a single IP
Network Load
Balancer
address per Availability
Zone per load balancer
that will not change.
EC2 Instances
54.69.111.179 EC2 Instance
1b
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Preserve Source IP
Preserves Client IP to back-ends
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Firewall Example with NLB Internet
Listeners
Target Groups
Targets
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IP as a Target
Use any IPv4 address from the load balancer’s VPC CIDR
for targets within load balancer’s VPC
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Network Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Health Checks
Supports both Network and Application
Target health checks
us-west-1a
34.214.45.162
EC2
NLB Instances
Health Check
Amazon
Route 53
us-west-1b
Health Check EC2
NLB
54.69.111.179 Instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Availability Zone Fail-over
34.214.45.162 TargetGroup 1
Customer VPC
54.69.111.179
us-west-1a
34.214.45.162
EC2
NLB Instances
Health Check
Amazon
Route 53
us-west-1b
Health Check
NLB
54.69.111.179
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon CloudWatch metrics
CloudWatch metrics provided for each load
balancer.
With the Network Load Balancer, you only pay for what you use. You are
charged for each hour or partial hour your Network load balancer is running and
the number of Load Balancer Capacity Units (LCU) used per hour
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Migrating to Network Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How do I pick the correct Load
Balancer?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer Network Load Balancer Classic Load Balancer
SSL offloading ✔ ✔
IP as Target ✔ ✔
Path-based routing,
Host-based routing ✔
Static IP ✔
WebSockets ✔ ✔
Container Support ✔
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
✔
For TCP in VPC use Network Load
Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.