SlideShare a Scribd company logo
1 of 64
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS re:INVENT
Elastic Load Balancing Deep Dive
and Best Practices
D a v i d P e s s i s
N o v e m b e r 3 0 , 2 0 1 7
N E T 4 0 2
© 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.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Layer 7 (application)Layer 4 (network)
Supports TCP and SSL
Incoming client connection bound to
server connection
No header modification
Proxy Protocol prepends source
and destination IP and ports to
request
Supports HTTP and HTTPS
Connection terminated at the load
balancer and pooled to the server
Headers may be modified
X-Forwarded-For header contains
client IP address
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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
TCP Workloads (VPC)
Previous Generation
for HTTP, HTTPS, TCP
(Classic Network)
HTTP & HTTPS (VPC)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SecureElastic Integrated Cost Effective
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load balancer used to
route incoming requests
to multiple EC2
instances, containers,
or IP addresses in your
VPC
ELB
EC2
Instance
EC2
Instance
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architecture
Customer VPC
EC2
Instance
EC2
Instance
us-west-1aus-west-1b
Amazon
Route 53
ELB VPC
ELB
ELB
© 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.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
New, feature-rich, Layer 7 load-balanced
platform
Content-based routing allows requests to
be routed to different applications behind
a single load balancer
Support for microservices and container-
based applications, including deep
integration with Elastic Container Service
Application Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Support for WebSockets and HTTP/2
Path and host-based routing
Improved health checks and additional
Amazon CloudWatch metrics
Improved performance for real-time and
streaming applications
Improved Elastic Load Balancing API
Load balancer API deletion protection
Application Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Feature launches in the last year…
• Host-based routing
• Server Name Identification (SNI)
• CloudWatch percentiles support
• Request tracing
• Native IPv6
• AWS WAF support
• New predefined security policies
• IP as a target
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the port and protocol which the load
balancer must listen on
Each Application Load Balancer needs
at least one listener to accept traffic
Each Application Load Balancer can have
up to 10 listeners
Routing rules are defined on listeners
Listeners
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load Balancer
Listener Listener
Target Group #1
Health Check Health Check Health Check
Target Group #2 Target Group #3
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Logical grouping of targets behind the load
balancer
Target groups can exist independently from the
load balancer
Regional construct that can be associated with
an Auto Scaling group
Target groups can contain up to 1,000 targets
Target groups
© 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.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ELB
EC2
Instance
EC2
Instance
EC2
Instance
Health checks ensure
that request traffic is
shifted away from a
failed instance
Health checks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Support for HTTP and HTTPS health checks
Customize the frequency and failure thresholds
Consider the depth and accuracy of your
health checks
Customize list of successful response codes,
for example, 200–300
Details of health check failures are returned via
the API and the AWS Management Console
Health checks
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load Balancer
Target Group #1
Health Check Health Check Health Check
EC2 EC2 EC2 EC2 EC2 EC2 ECS ECS ECS
Listener Listener
Target Group #2 Target Group #3
IP IP IP
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Support for EC2 instances and Amazon ECS
containers, and IP Addresses
EC2 instances can be registered with the same
target group using multiple ports
A single target can be registered with multiple
target groups
IP addresses both accessible within your
VPC or via DX and VPN
Targets
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load Balancer
Target Group #1
Health Check Health Check Health Check
EC2 EC2 EC2 IP IP IP ECS ECS ECS
Listener Listener
Target Group #2 Target Group #3
Rule (default) Rule (*/img/*) Rule (default)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Each listener can have one or more rules
for routing requests to target groups
Rules consist of conditions and actions
When a request meets the condition of the rule,
the action is taken
Today, rules can forward requests to a specified
target group
Rules
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Conditions can be specified in path pattern format
A path pattern is case-sensitive, can be up to 255
characters in length, and can contain any of the
following characters:
• A-Z, a-z, 0-9
• _ - . $ / ~ " ' @ : +
• & (using &)
• * (matches 0 or more characters)
• ? (matches exactly 1 character)
Rules (continued)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Host-based routing
Route based on host field in the HTTP header
Support multiple domains using a single load
balancer
Route each host name to a different target group
Combine host-based routing and path-based
routing
• 128-character limit
• A–Z, a–z, 0–9, -, .
• * (matches 0 or more characters)
• ? (matches exactly 1 character)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load Balancer
Target Group #1
Health Check Health Check Health Check
EC2 EC2 EC2 EC2 EC2 EC2 ECS ECS ECS
Listener
Rule (default) Rule (*/img/*)
Listener
Rule (default)
Target Group #2 Target Group #3
IP IP IP
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2 instances
registered behind a
Classic Load Balancer
ELB
EC2
Instance
EC2
Instance
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Running two separate
services with Classic
Load Balancer
ELB
EC2
Instance
EC2
Instance
EC2
Instance
EC2
Instance
EC2
Instance
ELB
EC2
Instance
orders.example.com
images.example.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ELB
/orders
example.com
EC2
Instance
EC2
Instance
EC2
Instance
EC2
Instance
EC2
Instance
EC2
Instance
/images
Application Load
Balancer allows for
multiple services to be
hosted behind a single
load balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ELB
/api
example.com
EC2
Instance
EC2
Instance
EC2
Instance
/test
Auto Scaling manages
the scaling of each
target group
independently
EC2
Instance
EC2
Instance
EC2
Instance
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer (ALB) is fully
integrated with Amazon EC2 Container Service
(Amazon ECS), managing target groups, paths,
and targets
ECS will automatically register tasks with the
load balancer using a dynamic port mapping
Can also be used with other container
technologies
ECS integration
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ELB
/api
example.com
EC2
Instance
EC2
Instance
EC2
Instance
ECS
Container
/test
Application Load
Balancer allows
containers to be
included in the target
group
ECS
Container
ECS
Container
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Predefined security policies
ELBSecurityPolicy-TLS-1-1-2017-01—Supports TLS
1.1 and above
ELBSecurityPolicy-TLS-1-2-2017-01—Strictly
supports TLS1.2
ELBSecurityPolicy-2016-08—New default policy,
same as Classic Load Balancer default policy
Windows XP Security Policy
Windows XP supported policy – Coming soon
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Server Name Indication (SNI)
Host multiple TLS secured applications, each
with its own TLS certificate
Bind multiple certificates to the same secure
listener on your load balancer
ALB will automatically choose the optimal TLS
certificate for each client
Support for both the classic RSA algorithm
and the newer, faster elliptic-curve-based ECDSA
algorithm
Integration with ACM
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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
Monitor web requests and protect web applications
from malicious requests at the load balancer
Block or allow requests based on conditions such as
IP addresses
Preconfigured protection to block common attacks,
such as SQL injection or cross-site scripting
Set up web ACLs and rules from WAF console and
apply them to the load balancer
X
IP as target demonstration
regional
deployment
eu-west-1
us-east-1
Streaming service
Load Balancing
Studio, content, partner
Load Balancing
Geo DNS
us-west-2
ZuulEureka
CLB
Basic DNS
ALB
Netflix containers—Titus
EC2 applications should work in containers
unchanged
• Provide IP per container
• Native VPC, security group, IAM role support
Problems for load balancing
• Multitenant container EC2 hosts presented
problems
Titus container networking
Virtual Machine Host
ENI1
sg=X
ENI2
sg=Y,Z
IP1
IP2
IP3
sg=X sg=X sg=Y,Z Metadata proxy
App
container
pod root
veth<id>
App
container
pod root
veth<id>
App
container
pod root
veth<id>
Container 1 Container 2 Container 3
Linux Policy Based Routing
+ Traffic Control
169.254.169.254
NAT
Configuring ALBs with Spinnaker
Titus
Scheduler
Associate IP
Target Groups
Define
Cluster
Containers
Containers
ALB IP target group registration
Titus
3. Update
Containers
1. Launch 2. IP
IP Target
Group
ALB
Advanced features—downscaling
Containers
Containers
Titus
2. Drain
Containers
3. Terminate container
IP Target
Group
ALB
✖
1. Downscaling required
Advanced features—healthchecks
Containers
Containers
Titus
1. Poll
Containers
2. Terminate and
replace unhealthy
IP Target
Group
ALB
✖
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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 in RFC 1918 ranges
(10.0.0.0/8, 172.16.0.0/12, and
192.168.0.0/16)
Use any IP address from the RFC 6598 range
(100.64.0.0/10) for targets located outside the
load balancer’s VPC (this includes Peered
VPC, EC2-Classic, and on-premises targets
reachable over Direct Connect or VPN).
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Requests distributed evenly across multiple Availability Zones
Load balancer absorbs impact of DNS caching
Eliminates imbalances in backend instance utilization
No additional bandwidth charge for cross-zone traffic
Enabled on all ALBs
Cross-zone load balancing
Multiple Availability Zones
ELB VPC Customer VPC
EC2
InstanceELB
ELB
EC2
Instance
us-west-1aus-west-1b
Amazon
Route 53
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Multiple Availability Zones
ELB VPC Customer VPC
EC2
InstanceELB
ELB
us-west-1aus-west-1b
Amazon
Route 53
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cross-zone load balancing
ELB VPC Customer VPC
EC2
InstanceELB
ELB
us-west-1aus-west-1b
Amazon
Route 53
EC2
Instances
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudWatch metrics provided for each load
balancer at 1-minute granularity
Request response times provided with percentile
dimensions in the 90th, 95th, 99th or 99.9th
percentile
Provide detailed insight into the health of the load
balancer and application stack
CloudWatch alarms can be configured to notify
or take action if any metric goes outside of the
acceptable range
Amazon CloudWatch metrics
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Healthy host count
The count of the number of healthy instances
in each Availability Zone
Most common cause of unhealthy hosts is
health check exceeding the allocated timeout
Test by making repeated requests to the
back-end instance from another EC2 instance
View at the zonal dimension
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Latency
Measures the elapsed time, in seconds, from when the request leaves the
load balancer until the response is received
Test by sending requests to the back-end instance from another instance
Using min, average, and max CloudWatch
stats, provide upper and lower bounds for latency
Debug individual requests using access logs
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Rejected connection count
The number of connections that were rejected because the
load balancer could not establish a connection with a healthy
target in order to route the request
This replaces the surge queue metrics that are used
by the Classic Load Balancer
Surge queues often impact client applications,
which fast request rejection improves
Normally a sign of an under-scaled application
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Target group metrics
The following metrics are now provided at the target group level, allowing
for individual applications to be closely monitored:
• RequestCount
• HTTPCode_Target_2XX_Count
• HTTPCode_Target_3XX_Count
• HTTPCode_Target_4XX_Count
• HTTPCode_Target_5XX_Count
• TargetResponseTime (Latency)
• UnHealthyHostCount
• HealthyHostCount
• Request Count per Target
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Provide detailed information on each
request processed by the load balancer
Includes request time, client IP address,
latencies, request path, and server
responses
Delivered to an Amazon S3 bucket every
5 or 60 minutes
Access logs
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Load Balancer pricing
With the Application Load Balancer, you pay only 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 (LCUs) used per hour.
• $0.0225 per Application Load Balancer-hour (or partial hour)
• $0.008 per LCU-hour (or partial hour)
Hourly charge is 10% cheaper than Classic Load
Balancer today, reducing the cost for the virtually all
of our customers.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load balancer capacity units
An LCU measures the dimensions on which the Application
Load Balancer processes your traffic (averaged over an hour).
The three dimensions measured are:
• 25 new connections per second
• 3,000 active connections per minute
• 2.22 Mbps (which translates to 1 GB per hour)
• 1,000 rule evaluations per second
You are charged only on the dimension with the highest
usage over the hour
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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
Migration is as simple as creating a new
Application Load Balancer, registering targets, and
updating DNS to point to the new CNAME
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Migration Wizard
The migration wizard in the AWS console
makes it simple to create an Application Load
Balancer with a configuration that is equivalent
to your Classic Load Balancer
Enables you to quickly test your application
with a new type of load balancer
After migration, you can configure the
advanced features offered by the new load
balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
When should I use Application
Load Balancer?
Application Load
Balancer
Network Load Balancer Classic Load Balancer
Protocol HTTP, HTTPS,HTTP/2 TCP TCP, SSL, HTTP, HTTPS
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.
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
For TCP, use Network Load
Balancer
For all other use cases, use
Application Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Learn more
https://aws.amazon.com/elasticloadbalancing/
https://aws.amazon.com/documentation/elastic-load-balancing/
Follow me on Twitter: @davidpessis
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

AWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best PracticesAWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best Practices
Amazon Web Services
 

What's hot (20)

Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...
Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...
Your Virtual Data Center: VPC Fundamentals and Connectivity Options (NET201) ...
 
AWS Foundations
AWS FoundationsAWS Foundations
AWS Foundations
 
AWS Web Application Firewall and AWS Shield - Webinar
AWS Web Application Firewall and AWS Shield - Webinar AWS Web Application Firewall and AWS Shield - Webinar
AWS Web Application Firewall and AWS Shield - Webinar
 
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control Tower
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
 
AWS와 함께하는 클라우드 컴퓨팅 (강철 AWS 매니저) :: AWS 기초 교육 온라인 세미나
AWS와 함께하는 클라우드 컴퓨팅 (강철 AWS 매니저) :: AWS 기초 교육 온라인 세미나AWS와 함께하는 클라우드 컴퓨팅 (강철 AWS 매니저) :: AWS 기초 교육 온라인 세미나
AWS와 함께하는 클라우드 컴퓨팅 (강철 AWS 매니저) :: AWS 기초 교육 온라인 세미나
 
AWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On GuideAWS Application Migration Service-Hands-On Guide
AWS Application Migration Service-Hands-On Guide
 
AWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best PracticesAWS Multi-Account Architecture and Best Practices
AWS Multi-Account Architecture and Best Practices
 
AWS 101: Introduction to AWS
AWS 101: Introduction to AWSAWS 101: Introduction to AWS
AWS 101: Introduction to AWS
 
Introduction to AWS Cost Management
Introduction to AWS Cost ManagementIntroduction to AWS Cost Management
Introduction to AWS Cost Management
 
Introduction To AWS & AWS Lambda
Introduction To AWS & AWS LambdaIntroduction To AWS & AWS Lambda
Introduction To AWS & AWS Lambda
 
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
Elastic  Load Balancing Deep Dive - AWS Online Tech TalkElastic  Load Balancing Deep Dive - AWS Online Tech Talk
Elastic Load Balancing Deep Dive - AWS Online Tech Talk
 
AWS Connectivity, VPC Design and Security Pro Tips
AWS Connectivity, VPC Design and Security Pro TipsAWS Connectivity, VPC Design and Security Pro Tips
AWS Connectivity, VPC Design and Security Pro Tips
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Deep dive into AWS IAM
Deep dive into AWS IAMDeep dive into AWS IAM
Deep dive into AWS IAM
 
AWS Webinar Series - Cost Optimisation Levers, Tools, and Strategies
AWS Webinar Series - Cost Optimisation Levers, Tools, and StrategiesAWS Webinar Series - Cost Optimisation Levers, Tools, and Strategies
AWS Webinar Series - Cost Optimisation Levers, Tools, and Strategies
 
Understand AWS Pricing
Understand AWS PricingUnderstand AWS Pricing
Understand AWS Pricing
 
KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019
KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019
KINX와 함께 하는 AWS Direct Connect 도입 - 남시우 매니저, KINX :: AWS Summit Seoul 2019
 
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
[REPEAT] Microsoft Active Directory Deep Dive (WIN303-R) - AWS re:Invent 2018
 

Similar to Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017

Similar to Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017 (20)

NET304_Deep Dive into the New Network Load Balancer
NET304_Deep Dive into the New Network Load BalancerNET304_Deep Dive into the New Network Load Balancer
NET304_Deep Dive into the New Network Load Balancer
 
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
[REPEAT 1] Elastic Load Balancing: Deep Dive and Best Practices (NET404-R1) -...
 
Introducing Amazon Fargate
Introducing Amazon FargateIntroducing Amazon Fargate
Introducing Amazon Fargate
 
Scaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million UsersScaling Up to Your First 10 Million Users
Scaling Up to Your First 10 Million Users
 
AWS User Group 5/12 meetup - ECS
AWS User Group 5/12 meetup - ECSAWS User Group 5/12 meetup - ECS
AWS User Group 5/12 meetup - ECS
 
CON202-Getting Started with Docker and Amazon ECS
CON202-Getting Started with Docker and Amazon ECSCON202-Getting Started with Docker and Amazon ECS
CON202-Getting Started with Docker and Amazon ECS
 
Scale Website dan Mobile Applications Anda di AWS hingga 10 juta pengguna
Scale Website dan Mobile Applications Anda di AWS hingga 10 juta penggunaScale Website dan Mobile Applications Anda di AWS hingga 10 juta pengguna
Scale Website dan Mobile Applications Anda di AWS hingga 10 juta pengguna
 
Running Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelRunning Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day Israel
 
Kubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKSKubernetes on AWS with Amazon EKS
Kubernetes on AWS with Amazon EKS
 
Introduction to Amazon CloudFront and AWS Lambda@Edge - CTD201 - re:Invent 2017
Introduction to Amazon CloudFront and AWS Lambda@Edge - CTD201 - re:Invent 2017Introduction to Amazon CloudFront and AWS Lambda@Edge - CTD201 - re:Invent 2017
Introduction to Amazon CloudFront and AWS Lambda@Edge - CTD201 - re:Invent 2017
 
CTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
CTD201_Introduction to Amazon CloudFront and AWS Lambda@EdgeCTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
CTD201_Introduction to Amazon CloudFront and AWS Lambda@Edge
 
Introduction to AWS Fargate & Amazon Elastic Container Service for Kubernetes
Introduction to AWS Fargate & Amazon Elastic Container Service for KubernetesIntroduction to AWS Fargate & Amazon Elastic Container Service for Kubernetes
Introduction to AWS Fargate & Amazon Elastic Container Service for Kubernetes
 
Modernize and Move your Microsoft Applications on AWS
Modernize and Move your Microsoft Applications on AWSModernize and Move your Microsoft Applications on AWS
Modernize and Move your Microsoft Applications on AWS
 
DEV204_Debugging Modern Applications Introduction to AWS X-Ray
DEV204_Debugging Modern Applications Introduction to AWS X-RayDEV204_Debugging Modern Applications Introduction to AWS X-Ray
DEV204_Debugging Modern Applications Introduction to AWS X-Ray
 
CON317_Advanced container management at catsndogs.lol
CON317_Advanced container management at catsndogs.lolCON317_Advanced container management at catsndogs.lol
CON317_Advanced container management at catsndogs.lol
 
Containers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech Talks
Containers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech TalksContainers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech Talks
Containers on AWS: What You Missed at re:Invent 2017 - AWS Online Tech Talks
 
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
Become a Serverless Black Belt: Optimizing Your Serverless Applications - SRV...
 
Introducing Service Discovery for Amazon ECS - CON403 - re:Invent 2017
Introducing Service Discovery for Amazon ECS - CON403 - re:Invent 2017Introducing Service Discovery for Amazon ECS - CON403 - re:Invent 2017
Introducing Service Discovery for Amazon ECS - CON403 - re:Invent 2017
 
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech TalksAWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
AWS X-Ray: Debugging Applications at Scale - AWS Online Tech Talks
 
EC2_and_VPC_workshop
EC2_and_VPC_workshopEC2_and_VPC_workshop
EC2_and_VPC_workshop
 

More from Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Elastic Load Balancing Deep Dive and Best Practices - NET402 - re:Invent 2017

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS re:INVENT Elastic Load Balancing Deep Dive and Best Practices D a v i d P e s s i s N o v e m b e r 3 0 , 2 0 1 7 N E T 4 0 2
  • 2. © 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
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Layer 7 (application)Layer 4 (network) Supports TCP and SSL Incoming client connection bound to server connection No header modification Proxy Protocol prepends source and destination IP and ports to request Supports HTTP and HTTPS Connection terminated at the load balancer and pooled to the server Headers may be modified X-Forwarded-For header contains client IP address
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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 TCP Workloads (VPC) Previous Generation for HTTP, HTTPS, TCP (Classic Network) HTTP & HTTPS (VPC)
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. SecureElastic Integrated Cost Effective
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. EC2 Instance
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load balancer used to route incoming requests to multiple EC2 instances, containers, or IP addresses in your VPC ELB EC2 Instance EC2 Instance EC2 Instance
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Architecture Customer VPC EC2 Instance EC2 Instance us-west-1aus-west-1b Amazon Route 53 ELB VPC ELB ELB
  • 9. © 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
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. New, feature-rich, Layer 7 load-balanced platform Content-based routing allows requests to be routed to different applications behind a single load balancer Support for microservices and container- based applications, including deep integration with Elastic Container Service Application Load Balancer
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Support for WebSockets and HTTP/2 Path and host-based routing Improved health checks and additional Amazon CloudWatch metrics Improved performance for real-time and streaming applications Improved Elastic Load Balancing API Load balancer API deletion protection Application Load Balancer
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Feature launches in the last year… • Host-based routing • Server Name Identification (SNI) • CloudWatch percentiles support • Request tracing • Native IPv6 • AWS WAF support • New predefined security policies • IP as a target
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load Balancer Listener Listener
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the port and protocol which the load balancer must listen on Each Application Load Balancer needs at least one listener to accept traffic Each Application Load Balancer can have up to 10 listeners Routing rules are defined on listeners Listeners
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load Balancer Listener Listener Target Group #1 Health Check Health Check Health Check Target Group #2 Target Group #3
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Logical grouping of targets behind the load balancer Target groups can exist independently from the load balancer Regional construct that can be associated with an Auto Scaling group Target groups can contain up to 1,000 targets Target groups
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Health checks allow for traffic to be shifted away from failed instances
  • 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ELB EC2 Instance EC2 Instance EC2 Instance Health checks ensure that request traffic is shifted away from a failed instance Health checks
  • 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Support for HTTP and HTTPS health checks Customize the frequency and failure thresholds Consider the depth and accuracy of your health checks Customize list of successful response codes, for example, 200–300 Details of health check failures are returned via the API and the AWS Management Console Health checks
  • 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load Balancer Target Group #1 Health Check Health Check Health Check EC2 EC2 EC2 EC2 EC2 EC2 ECS ECS ECS Listener Listener Target Group #2 Target Group #3 IP IP IP
  • 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Support for EC2 instances and Amazon ECS containers, and IP Addresses EC2 instances can be registered with the same target group using multiple ports A single target can be registered with multiple target groups IP addresses both accessible within your VPC or via DX and VPN Targets
  • 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load Balancer Target Group #1 Health Check Health Check Health Check EC2 EC2 EC2 IP IP IP ECS ECS ECS Listener Listener Target Group #2 Target Group #3 Rule (default) Rule (*/img/*) Rule (default)
  • 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Each listener can have one or more rules for routing requests to target groups Rules consist of conditions and actions When a request meets the condition of the rule, the action is taken Today, rules can forward requests to a specified target group Rules
  • 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Conditions can be specified in path pattern format A path pattern is case-sensitive, can be up to 255 characters in length, and can contain any of the following characters: • A-Z, a-z, 0-9 • _ - . $ / ~ " ' @ : + • & (using &amp;) • * (matches 0 or more characters) • ? (matches exactly 1 character) Rules (continued)
  • 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Host-based routing Route based on host field in the HTTP header Support multiple domains using a single load balancer Route each host name to a different target group Combine host-based routing and path-based routing • 128-character limit • A–Z, a–z, 0–9, -, . • * (matches 0 or more characters) • ? (matches exactly 1 character)
  • 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load Balancer Target Group #1 Health Check Health Check Health Check EC2 EC2 EC2 EC2 EC2 EC2 ECS ECS ECS Listener Rule (default) Rule (*/img/*) Listener Rule (default) Target Group #2 Target Group #3 IP IP IP
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon EC2 instances registered behind a Classic Load Balancer ELB EC2 Instance EC2 Instance EC2 Instance
  • 28. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Running two separate services with Classic Load Balancer ELB EC2 Instance EC2 Instance EC2 Instance EC2 Instance EC2 Instance ELB EC2 Instance orders.example.com images.example.com
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ELB /orders example.com EC2 Instance EC2 Instance EC2 Instance EC2 Instance EC2 Instance EC2 Instance /images Application Load Balancer allows for multiple services to be hosted behind a single load balancer
  • 30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ELB /api example.com EC2 Instance EC2 Instance EC2 Instance /test Auto Scaling manages the scaling of each target group independently EC2 Instance EC2 Instance EC2 Instance
  • 31. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Application Load Balancer (ALB) is fully integrated with Amazon EC2 Container Service (Amazon ECS), managing target groups, paths, and targets ECS will automatically register tasks with the load balancer using a dynamic port mapping Can also be used with other container technologies ECS integration
  • 32. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. ELB /api example.com EC2 Instance EC2 Instance EC2 Instance ECS Container /test Application Load Balancer allows containers to be included in the target group ECS Container ECS Container
  • 33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Predefined security policies ELBSecurityPolicy-TLS-1-1-2017-01—Supports TLS 1.1 and above ELBSecurityPolicy-TLS-1-2-2017-01—Strictly supports TLS1.2 ELBSecurityPolicy-2016-08—New default policy, same as Classic Load Balancer default policy Windows XP Security Policy Windows XP supported policy – Coming soon
  • 34. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Server Name Indication (SNI) Host multiple TLS secured applications, each with its own TLS certificate Bind multiple certificates to the same secure listener on your load balancer ALB will automatically choose the optimal TLS certificate for each client Support for both the classic RSA algorithm and the newer, faster elliptic-curve-based ECDSA algorithm Integration with ACM
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Native IPv6 support
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Application Load Balancer with WAF Monitor web requests and protect web applications from malicious requests at the load balancer Block or allow requests based on conditions such as IP addresses Preconfigured protection to block common attacks, such as SQL injection or cross-site scripting Set up web ACLs and rules from WAF console and apply them to the load balancer X
  • 37. IP as target demonstration
  • 38. regional deployment eu-west-1 us-east-1 Streaming service Load Balancing Studio, content, partner Load Balancing Geo DNS us-west-2 ZuulEureka CLB Basic DNS ALB
  • 39. Netflix containers—Titus EC2 applications should work in containers unchanged • Provide IP per container • Native VPC, security group, IAM role support Problems for load balancing • Multitenant container EC2 hosts presented problems
  • 40. Titus container networking Virtual Machine Host ENI1 sg=X ENI2 sg=Y,Z IP1 IP2 IP3 sg=X sg=X sg=Y,Z Metadata proxy App container pod root veth<id> App container pod root veth<id> App container pod root veth<id> Container 1 Container 2 Container 3 Linux Policy Based Routing + Traffic Control 169.254.169.254 NAT
  • 41. Configuring ALBs with Spinnaker Titus Scheduler Associate IP Target Groups Define Cluster
  • 42. Containers Containers ALB IP target group registration Titus 3. Update Containers 1. Launch 2. IP IP Target Group ALB
  • 43. Advanced features—downscaling Containers Containers Titus 2. Drain Containers 3. Terminate container IP Target Group ALB ✖ 1. Downscaling required
  • 44. Advanced features—healthchecks Containers Containers Titus 1. Poll Containers 2. Terminate and replace unhealthy IP Target Group ALB ✖
  • 45. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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 in RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) Use any IP address from the RFC 6598 range (100.64.0.0/10) for targets located outside the load balancer’s VPC (this includes Peered VPC, EC2-Classic, and on-premises targets reachable over Direct Connect or VPN).
  • 46. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Requests distributed evenly across multiple Availability Zones Load balancer absorbs impact of DNS caching Eliminates imbalances in backend instance utilization No additional bandwidth charge for cross-zone traffic Enabled on all ALBs Cross-zone load balancing
  • 47. Multiple Availability Zones ELB VPC Customer VPC EC2 InstanceELB ELB EC2 Instance us-west-1aus-west-1b Amazon Route 53 © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 48. Multiple Availability Zones ELB VPC Customer VPC EC2 InstanceELB ELB us-west-1aus-west-1b Amazon Route 53 © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 49. Cross-zone load balancing ELB VPC Customer VPC EC2 InstanceELB ELB us-west-1aus-west-1b Amazon Route 53 EC2 Instances © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. CloudWatch metrics provided for each load balancer at 1-minute granularity Request response times provided with percentile dimensions in the 90th, 95th, 99th or 99.9th percentile Provide detailed insight into the health of the load balancer and application stack CloudWatch alarms can be configured to notify or take action if any metric goes outside of the acceptable range Amazon CloudWatch metrics
  • 51. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Healthy host count The count of the number of healthy instances in each Availability Zone Most common cause of unhealthy hosts is health check exceeding the allocated timeout Test by making repeated requests to the back-end instance from another EC2 instance View at the zonal dimension
  • 52. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Latency Measures the elapsed time, in seconds, from when the request leaves the load balancer until the response is received Test by sending requests to the back-end instance from another instance Using min, average, and max CloudWatch stats, provide upper and lower bounds for latency Debug individual requests using access logs
  • 53. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Rejected connection count The number of connections that were rejected because the load balancer could not establish a connection with a healthy target in order to route the request This replaces the surge queue metrics that are used by the Classic Load Balancer Surge queues often impact client applications, which fast request rejection improves Normally a sign of an under-scaled application
  • 54. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target group metrics The following metrics are now provided at the target group level, allowing for individual applications to be closely monitored: • RequestCount • HTTPCode_Target_2XX_Count • HTTPCode_Target_3XX_Count • HTTPCode_Target_4XX_Count • HTTPCode_Target_5XX_Count • TargetResponseTime (Latency) • UnHealthyHostCount • HealthyHostCount • Request Count per Target
  • 55. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Provide detailed information on each request processed by the load balancer Includes request time, client IP address, latencies, request path, and server responses Delivered to an Amazon S3 bucket every 5 or 60 minutes Access logs
  • 56. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Application Load Balancer pricing With the Application Load Balancer, you pay only 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 (LCUs) used per hour. • $0.0225 per Application Load Balancer-hour (or partial hour) • $0.008 per LCU-hour (or partial hour) Hourly charge is 10% cheaper than Classic Load Balancer today, reducing the cost for the virtually all of our customers.
  • 57. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load balancer capacity units An LCU measures the dimensions on which the Application Load Balancer processes your traffic (averaged over an hour). The three dimensions measured are: • 25 new connections per second • 3,000 active connections per minute • 2.22 Mbps (which translates to 1 GB per hour) • 1,000 rule evaluations per second You are charged only on the dimension with the highest usage over the hour
  • 58. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 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 Migration is as simple as creating a new Application Load Balancer, registering targets, and updating DNS to point to the new CNAME
  • 59. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Migration Wizard The migration wizard in the AWS console makes it simple to create an Application Load Balancer with a configuration that is equivalent to your Classic Load Balancer Enables you to quickly test your application with a new type of load balancer After migration, you can configure the advanced features offered by the new load balancer
  • 60. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. When should I use Application Load Balancer?
  • 61. Application Load Balancer Network Load Balancer Classic Load Balancer Protocol HTTP, HTTPS,HTTP/2 TCP TCP, SSL, HTTP, HTTPS 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.
  • 62. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. For TCP, use Network Load Balancer For all other use cases, use Application Load Balancer
  • 63. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Learn more https://aws.amazon.com/elasticloadbalancing/ https://aws.amazon.com/documentation/elastic-load-balancing/ Follow me on Twitter: @davidpessis
  • 64. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!