Day - 05 | Elastic Load Balancing & Auto Scaling Groups | AWS Cloud Practitioner Certification CLF-C02
Anshul Agarwal
? SDET + DevOps ? | Selenium/Appium (Java & Python) | API testing (Postman + RestAssured) | Cypress | WebdriverIO | Playwright | Robot Framework | CI/CD | Python | AWS | Docker | Linux | Terraform | Jenkins |
? Elastic Load Balancing & Auto Scaling Groups
?? Scalability & High Availability
?? Vertical Scalability
?? Horizontal Scalability
?? High Availability
?? High Availability & Scalability For EC2
?? Scalability vs Elasticity vs Agility
?? What is load balancing?
? Why use a load balancer?
? Why use an Elastic Load Balancer?
?? What’s an Auto Scaling Group?
? Auto Scaling Groups Scaling Strategies
?? ELB & ASG Summary
Scalability & High Availability
Scalability refers to the ability of a system to handle increased load by adding resources.
It can be:
Vertical Scalability
Vertical scalability (or scaling up) involves increasing the capacity of a single instance or server. This can be done by adding more CPU, RAM, or storage. For example, your application runs on a t2.micro. Scaling that application vertically means running it on a t2.large. Vertical scalability is very common for non distributed systems, such as a database. There’s usually a limit to how much you can vertically scale (hardware limit).
Horizontal Scalability
Horizontal Scalability means increasing the number of instances / systems for your application. This implies distributed systems. It’s easy to horizontally scale thanks the cloud offerings such as Amazon EC2.
High Availability
High availability ensures that a system remains operational even when some components fail. The goal of high availability is to survive a data center loss (disaster).
This involves:
High Availability & Scalability For EC2
? From: t2.nano - 0.5G of RAM, 1 vCPU
? To: u-12tb1.metal – 12.3 TB of RAM, 448 vCPUs
? Auto Scaling Group
? Load Balancer
? Auto Scaling Group multi AZ
? Load Balancer multi AZ
Scalability vs Elasticity vs Agility
领英推荐
What is load balancing?
Load balancing is the process of distributing network or application traffic across multiple servers. It ensures no single server becomes a bottleneck, thus improving performance and reliability.
Why use a load balancer?
Why use an Elastic Load Balancer?
Elastic Load Balancing (ELB) is a managed load balancing service provided by AWS.
? Application Load Balancer (HTTP / HTTPS only) – Layer 7
? Network Load Balancer (ultra-high performance, allows for TCP) – Layer 4
? Classic Load Balancer (slowly retiring) – Layer 4 & 7
What’s an Auto Scaling Group?
An Auto Scaling Group (ASG) is a collection of EC2 instances that are treated as a logical group for the purposes of scaling and management.
The goal of an Auto Scaling Group (ASG) is to:
? Scale out (add EC2 instances) to match an increased load
? Scale in (remove EC2 instances) to match a decreased load
? Ensure we have a minimum and a maximum number of machines running
? Automatically register new instances to a load balancer
? Replace unhealthy instances
Auto Scaling Groups Scaling Strategies
? Target Tracking Scaling: Maintain a target value for a specific metric (e.g., average CPU usage).
? I want the average ASG CPU to stay at around 40%
? Scheduled Scaling: Scale in steps based on specified thresholds.
? Anticipate a scaling based on known usage patterns
? Example: increase the min. capacity to 10 at 5 pm on Fridays
? Simple / Step Scaling: Add or remove instances when a specific condition is met.
? When a CloudWatch alarm is triggered (example CPU > 70%), then add 2 units
? When a CloudWatch alarm is triggered (example CPU < 30%), then remove 1
ELB & ASG Summary
? Distribute traffic across backend EC2 instances, can be Multi-AZ
? Supports health checks
? 3 types: Application LB (HTTP – L7), Network LB (TCP – L4), Classic LB (old)
? Implement Elasticity for your application, across multiple AZ
? Scale EC2 instances based on the demand on your system, replace unhealthy
? Integrated with the ELB
Happy Learning !