You are on page 1of 20

LOAD- Prashant Raj (C-71) (1-5)

BALANCING Vivek Pundkar (C-77) (18-end)


& AUTO Sarang Rajurkar (D-3) (12-17)
SCALING Pritesh Gaikwad (C-74) (6-11)
ON AWS Pushkar Pawar (C-64) (Demo)
LOADBALANCI
NG

9/3/20XX Presentation Title 2


What is load balancing?
• Load balancers are servers that forward internet traffic to multiple servers
(EC2 Instances) downstream.

24/10/2021 Load Balancing 3


Why to use load balancer?
• Spread load across multiple downstream instances.
• Expose a single point of access (DNS) to application.
• Seamlessly handle failures of downstream instances.
• Do regular health checks to your instances.
• Provide SSL termination (HTTPS) for application
• High availability across zone
• Separate public traffic from private traffic.

24/10/2021 Load Balancer 4


AWS EC2 Load Balancer?
• An ELB (EC2 Load Balancer) is a managed load balancer.
• AWS guarantees that it will be working
• AWS takes cars of upgrades, maintenance, high availability
• AWS provides only a few configuration knobs

• It is integrated with many AWS offerings/services

24/10/2021 EC2 Load Balancer 5


Health Checks?
• Health Checks are crucial for Load Balancers
• They enable the load balancer to know if instances it forwards traffic to are
available to reply for requests
• The health check is done on a port and a route (/health is common)
• If the response is not 200 (OK), then the instance is unhealthy.

Health Checks
Port 8080
Route /health

24/10/2021 Load Balancer Health Checks 6


How To Create Load Balancer On AWS ?
Create Target Group
1. Choose Target Type (let’s say EC2 Instances)
2. Choose Protocol + Port
3. Choose Health Check Route
Create Load Balancer
4. Security Groups (Network inbound/outbound traffic)
5. Listeners and Routing
Register EC2 instances to target groups

9/3/20XX Presentation Title 7


Types of load balancer on AWS

1 2 3
Classic Load Application Load Balancer Network Load Balancer
Balancer (V2-new generation) - 2016 (V2-new generation) -
(V1-old generation) - 2009 2016

24/10/2021 Types - Load Balancer 8


• Application load balancers allow to do:

1 • Support for EC2-Classic


• Support for TCP and SSL listeners
Classic Load
• Support for sticky sessions using application-generated
Balancer
cookies
(V1-old generation) - 2009 • Deprecated and now often replaced with
application load balancer.

24/10/2021 Application Load Balancer 9


• Application load balancers allow to do:
• Load balancing to multiple HTTP applications across machines
2 (multiple instances)
• Load balancing to multiple applications on same machines (ex:
containerized applications)
Application Load Balancer • Load balancing based on route in URL
(V2-new generation) - 2016 • Load balancing based on hostname in URL
• They are really good for micro services & container
based application

24/10/2021 Application Load Balancer 10


2

Health Checks
Route /user HTT
WWW
P

Application Load Balancer

Health Checks
Route /search HTT
(V2-new generation) - 2016 WWW P

24/10/2021 Application Load Balancer 11


• When we use Network Load Balancer:
3 • Fourth layer of the Open Systems Interconnection (OSI)
model
• Ability to handle volatile workloads and scale to millions of
requests per second
Network Load Balancer • Support for static IP addresses for the load balancer.
(V2-new generation) - • Support for monitoring the health of each service
2016 independently
• Support for routing requests to multiple applications

24/10/2021 Application Load Balancer 12


AUTO-
SCALING

9/3/20XX Presentation Title 13


What’s an Auto Scaling?
• In real life, the load on your websites and application can change
• In the cloud, you can create and get rid of servers very quickly

• Goals of Auto Scaling


• Scale out to match an increased load
• Scale in to match decreased load
• Ensure we have a min and max number of machines running
• Automatically register new instances to load balancer

24/10/2021 Auto Scaling Group 14


Key Terms
• Scale Out
• Achieving scalability by increasing the number of ec2 instances.

• Scale In
• Achieving scalability by decreasing the number oof ec2 instances.

9/3/20XX Presentation Title 15


Auto Scaling Group in AWS
Maximum Size

Actual Size / Desired Capacity Scale Out As Needed

Minimum Size

24/10/2021 Auto Scaling AWS 16


ASG Attributes in AWS
• A launch configuration
• AMI + Instance Type
• EC2 User Data
• EBS Volumes
• Security Groups
• SSH Key Pair
• Min / Max Size / Initial Capacity
• Network + Subnets Information
• Load Balancer Information
• Scaling Policies

24/10/2021 ASG Attributes 17


Scaling Plans
• Default: By ensuring current capacity of healthy instances
remains same (never less than min)
• Manual Scaling: Modify via API, Trigger, CLI, AWS Console
• Scheduled: Based in Time Events
• Dynamic Scaling: Scale on AWS CloudWatch Metrics

9/3/20XX Presentation Title 18


Complete Scenario …
Auto Scaling Scaling
Groups Launch Configuration Plan
• EC2 instances i.e. servers • Auto Scaling Groups use a • A scaling plan tells Auto
are managed by auto- launch configuration to Scaling when and how to
scaling groups launch to launch EC2 scale
instances

• Create Auto Scaling groups • Create scaling plan based


by defining the min, max • Uses the given Ami and on occurrence of specified
and optionally the desired EC2 instance type conditions (dynamic
number of running scaling) or create a plan
instances i.e. servers based in a specific
schedule

9/3/20XX Presentation Title 19


Load Balancer &
Scaling Groups Works
• Configure your Auto Scaling Group to work with one or more
Elastic Load Balancer
• Automatically registers new instances, deregisters on termination
• Use ELB health checks in your Auto Scaling Group
• Use ELB metrics in scaling policies

9/3/20XX Presentation Title 20

You might also like