Introduction to Elastic Load Balancing and EC2 Auto Scaling
Distribute traffic across healthy targets and scale capacity with demand.
- 2 lessons
- Module quiz
An application running on a single server stops when that server fails and slows down when demand exceeds its capacity. Running several servers across Availability Zones solves both problems, but it needs a single entry point that spreads requests across healthy servers, and a way to add and remove servers as demand changes.
Elastic Load Balancing (ELB) provides the entry point. A load balancer receives traffic and distributes it across healthy targets, such as EC2 instances, containers or Lambda functions, in several Availability Zones, and stops sending traffic to targets that fail health checks. Amazon EC2 Auto Scaling adds or removes instances automatically to match demand and replaces instances that become unhealthy. Load balancers are charged per hour and per unit of capacity used; Auto Scaling itself is free.
Where these services fit
Together, these services give applications high availability and elasticity. Developer questions focus on choosing between the Application Load Balancer and the Network Load Balancer, sticky sessions, finding the client's IP address behind a load balancer through the X-Forwarded-For header, and target tracking scaling policies.
How this module is organised
Routing Traffic with Load Balancers and Health Checks compares the load balancer types, routing, health checks and related features. Matching Capacity to Demand with EC2 Auto Scaling explains Auto Scaling groups, scaling policies, health and lifecycle settings, and how new versions are rolled out.