Module 10
Module 10
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module overview
Topics Activities
• Elastic Load Balancing activity
• Elastic Load Balancing
• Amazon CloudWatch activity
• Amazon CloudWatch
Knowledge check
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2
Module objectives
After completing this module, you should be able to:
• Indicate how to distribute traffic across Amazon Elastic Compute Cloud
(Amazon EC2) instances by using Elastic Load Balancing
• Identify how Amazon CloudWatch enables you to monitor AWS resources
and applications in real time
• Explain how Amazon EC2 Auto Scaling launches and releases servers in
response to workload changes
• Perform scaling and load balancing tasks to improve an architecture
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3
Section 1: Elastic Load Balancing
Module 10: Automatic Scaling and Monitoring
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Load Balancing
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 5
Types of load balancers
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 6
How Elastic Load Balancing works
• With Application Load
Balancers and Network Load
Balancers, you register
targets in target groups, and AWS Cloud
route traffic to the target Load balancer accepts
incoming traffic
groups. Availability Zone A
from clients.
Availability Zone B
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 7
Elastic Load Balancing use cases
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 8
Activity: Elastic Load Balancing
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9
Activity: Elastic Load Balancing Answers
You have extremely spiky and unpredictable TCP Network Load Balancer
traffic.
You need simple load balancing with multiple Classic Load Balancer
protocols.
You need a load balancer that can handle millions of Network Load Balancer
requests per second while maintaining low latencies.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 10
Load balancer monitoring
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 11
Section 1 key • Elastic Load Balancing distributes incoming
application or network traffic across multiple
takeaways targets in one or more Availability Zones.
• Elastic Load Balancing supports three types of
load balancers:
• Application Load Balancer
• Network Load Balancer
• Classic Load Balancer
• ELB offers instance health checks, security, and
monitoring.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 12
Section 2: Amazon CloudWatch
Module 10: Automatic Scaling and Monitoring
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitoring AWS resources
To use AWS efficiently, you need insight into your AWS resources:
• How do you know when you should launch more Amazon EC2 instances?
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
Amazon CloudWatch
• Monitors –
• AWS resources
• Applications that run on AWS
• Collects and tracks –
Amazon • Standard metrics
• Custom metrics
CloudWatch
• Alarms –
• Send notifications to an Amazon SNS topic
• Perform Amazon EC2 Auto Scaling or Amazon
EC2 actions
• Events –
• Define rules to match changes in AWS
environment and route these events to one or
more target functions or streams for
processing
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15
CloudWatch alarms
• Create alarms based on –
• Static threshold
• Anomaly detection
• Metric math expression
• Specify –
• Namespace
• Metric
• Statistic
• Period
• Conditions
• Additional configuration
• Actions
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16
Activity: Amazon CloudWatch
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19
Section 3: Amazon EC2 Auto Scaling
Module 10: Automatic Scaling and Monitoring
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why is scaling important?
Unused Over
capacity capacity
Su M T W Th F Sa Su M T W Th F Sa
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21
Amazon EC2 Auto Scaling
• Helps you maintain application
availability
• Enables you to automatically add or
remove EC2 instances according to
conditions that you define
• Detects impaired EC2 instances and
unhealthy applications, and replaces the
instances without your intervention
Su M T W Th F Sa • Provides several scaling options –
Manual, scheduled, dynamic or on-
Used capacity Provisioned capacity
demand, and predictive
(demand)
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22
Typical weekly traffic at Amazon.com
Provisioned capacity
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23
November traffic to Amazon.com
November
24 percent
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24
Auto Scaling groups
Desired capacity
Maximum size
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 25
Scaling out versus scaling in
Elastic Load
Balancing
Scheduled scaling
Launch configuration Auto Scaling group • Scheduled actions
• AMI • VPC and subnets
• Instance type • Load balancer Dynamic scaling
• IAM role • Scaling policies
• Security groups
• EBS volumes Predictive scaling
• AWS Auto Scaling
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 27
Implementing dynamic scaling
CPU
utilization If average CPU
utilization is
> 60% for 5
minutes…
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28
AWS Auto Scaling
• Monitors your applications and automatically
adjusts capacity to maintain steady, predictable
performance at the lowest possible cost
• Provides a simple, powerful user interface that
AWS Auto Scaling enables you to build scaling plans for resources,
including –
• Amazon EC2 instances and Spot Fleets
• Amazon Elastic Container Service (Amazon ECS) Tasks
• Amazon DynamoDB tables and indexes
• Amazon Aurora Replicas
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 29
Section 3 key • Scaling enables you to respond quickly to changes in
resource needs.
takeaways • Amazon EC2 Auto Scaling maintains application
availability by automatically adding or removing EC2
instances.
• An Auto Scaling group is a collection of EC2 instances.
• A launch configuration is an instance configuration
template.
• Dynamic scaling uses Amazon EC2 Auto Scaling,
CloudWatch, and Elastic Load Balancing.
• AWS Auto Scaling is a separate service from Amazon
EC2 Auto Scaling.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 30
Lab 6:
Scale and Load
Balance Your
Architecture
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31
Lab 6: Scenario
AWS Cloud
Region
Availability Zone A Availability Zone B
VPC: 10.0.0.0/16 Internet Public subnet 2:
Public subnet 1: gateway 10.0.2.0/24
10.0.0.0/24
Security group
NAT gateway
Web Server 1
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
Lab 6: Tasks
• Create an Amazon Machine Image (AMI) from a running instance.
• Create an Application Load Balancer.
• Create a launch configuration and an Auto Scaling group.
• Automatically scale new instances within a private subnet.
• Create Amazon CloudWatch alarms and monitor performance of your
infrastructure.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33
Lab 6: Final product
AWS Cloud
Region Availability Zone A Availability Zone B
VPC: 10.0.0.0/16 Internet
Public subnet 1: gateway Public subnet 2:
10.0.0.0/24 10.0.2.0/24
Security group
NAT gateway
Application
Private subnet 1: Load Balancer Private subnet 2:
10.0.1.0/24 10.0.3.0/24
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 34
~ 30 minutes
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 35
Lab debrief:
Key takeaways
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 36
Module wrap-up
Module 10: Automatic Scaling and Monitoring
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Module summary
In summary, in this module you learned how to:
• Indicate how to distribute traffic across Amazon Elastic Compute Cloud
(Amazon EC2) instances using Elastic Load Balancing.
• Identify how Amazon CloudWatch enables you to monitor AWS resources
and applications in real time.
• Explain how Amazon EC2 Auto Scaling launches and releases servers in
response to workload changes.
• Perform scaling and load balancing tasks to improve an architecture.
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 38
Complete the knowledge check
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 39
Sample exam question
Which service would you use to send alerts based on Amazon CloudWatch alarms?
Choice Response
B AWS CloudTrail
D Amazon Route 53
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 40
Sample exam question answer
Which service would you use to send alerts based on Amazon CloudWatch alarms?
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 41
Thank you
© 2022, Amazon Web Services, Inc. or its affiliates. All rights reserved. 42