ICS608
Cloud
Computing
CLOUDWATCH
Dr. JOHN ZAKI 1
TABLE OF CONTENTS
01 CLOUD WATCH
02 LAUNCH TEMPLATES
03 LOAD BALANCING
04 AUTOSCALING
Dr. JOHN ZAKI 2
RECALL….
Let’s recall our VPC design and think of our application that
has been hosted on EC2 with its DB hosted on RDS or
DynamoDB and its files like pictures or pdf files ARE hosted
on S3
Dr. JOHN ZAKI 3
AWS Cloud
Region
Availability Zone A Availability Zone B
Access Control List Access Control List
VPC
Public subnet Internet gateway Public subnet
Security group Security group DynamoDB
EC2 Instance EC2 Instance
Private subnet Private subnet
Amazon RDS instance Amazon RDS instance S3
Dr. JOHN ZAKI 4
How can we have an insight
into how our application is
performing and how it is
utilizing resources?
CLOUDWATCH
Dr. JOHN ZAKI 5
APP CASE
Let's consider an Employee application. It’s
the first day of the week and the users are
seeing latency on page loads.
It's probably not good enough to wait until a
user sees the slowdown, calls, or enters a
ticket saying, "Hello, your application is
running slow."
If you receive a call or a ticket from your
users, you can then react and troubleshoot
the issue.
Waiting for users to notice and report
issues to investigate will generally lead to
unhappy end users.
Dr. JOHN ZAKI 6
APP CASE - MONITORING
If we put monitoring, we can collect metrics and
logs generated by different services and
infrastructure hosting the application.
For instance, you need to know if the problem is
coming from EC2, or your DB, or your network
traffic???!!!
So, you collect data to help you identify the
problems and which service it is coming from.
Dr. JOHN ZAKI 7
METRICS, STATISTICS & BASELINE
1. Data points generated from resources → metrics
2. Metrics monitored over time → statistics
EXAMPLES:
1. EC2 CPUUtilization
2. NetworkIn, NetworkOut
3. RDS DatabaseConnections.
Once information is available → Establish a BASELINE.
BASLINE: Is the reference or the starting point used for comparing the performance.
For instance, if information collected deviates from the baseline by a certain threshold, you
can trigger automatic alerts to elevate the issue to be handled by someone or something.
Dr. JOHN ZAKI 8
WHAT ARE THE BENEFITS OF
MONITORING?
Dr. JOHN ZAKI 9
BENEFITS OF MONITORING
1. Escalate and solve problems.
2. Proactively respond to operational issues
3. Improve performance and reliability of your resources
4. Recognize security threats and events
5. Make data-driven decisions for your business
6. Create more cost-effective solutions
7. Enable visibility of distributed resources.
Dr. JOHN ZAKI 10
Dr. JOHN ZAKI 11
Dr. JOHN ZAKI 12
Dr. JOHN ZAKI 13
Dr. JOHN ZAKI 14
Dr. JOHN ZAKI 15
Dr. JOHN ZAKI 16
Allow you to create thresholds for the metrics you're monitoring.
These thresholds can define normal boundaries for the values of the metrics.
If a metric crosses a boundary for a period of time, the alarm would be triggered.
You can then take some automated actions based on the alarm
Dr. JOHN ZAKI 17
Dr. JOHN ZAKI 18
Dr. JOHN ZAKI 19
Dr. JOHN ZAKI 20
Dr. JOHN ZAKI 21
Dr. JOHN ZAKI 22
Dr. JOHN ZAKI 23
Dr. JOHN ZAKI 24
Dr. JOHN ZAKI 25
Dr. JOHN ZAKI 26
CloudWatch Metrics
1. Many AWS services send metrics automatically to CloudWatch. A rate of one
data point per metric per 5 min interval is called basic monitoring and it is free.
2. For more granularity, you can setup detailed monitoring for smaller periods at
extra cost.
3. CloudWatch is organized into containers called Namespaces (think of them as
categories)
4. Each AWS service sends data to CloudWatch attach a dimension to each metric
5. A dimension is (name/value) pair that is part of the metric identity.
6. You can setup custom metrics which allows you to publish your own metrics to
CloudWatch
7. To start posting custom metrics to CloudWatch, use PutMetricData API
Dr. JOHN ZAKI 27
Dr. JOHN ZAKI 28
TASK
HOW CAN YOU USE
EXTERNAL TOOLS
TO ANALYZE
CLOUDWATCH
METRICS
Dr. JOHN ZAKI 29
TASK
SUMMARIZE
CLOUDWATCH
LOGS
LOG AGENTS, LOG EVENT, LOG STREAM, LOG GROUPS
Dr. JOHN ZAKI 30
TASK
ATTEMPT TO
USE FIS
https://docs.aws.amazon.com/fis/latest/userguide/fis-tutorial-run-cpu-stress.html
Dr. JOHN ZAKI 31
AUTOSCALING & LOAD BALANCING
Region
Availability Zone A Availability Zone B
VPC DynamoDB
Public subnet Internet gateway
EC2 Instance
ELB
CloudWatch
Auto Scaling
S3
Dr. JOHN ZAKI 33
Region
Availability Zone A Availability Zone B
VPC DynamoDB
Internet gateway
Public subnet Public subnet
EC2 Instance ELB EC2 Instance
CloudWatch
Auto Scaling
S3
Dr. JOHN ZAKI 34
TASK
SUMMARIZE
ACTIVE-PASSIVE,
ACTIVE-ACTIVE
HIGH AVAILABILITY TYPES
SHOW EFFECT ON STATELESS AND STATEFUL
APPLICATIONS
Dr. JOHN ZAKI 37
Dr. JOHN ZAKI 41
Dr. JOHN ZAKI 42
Dr. JOHN ZAKI 43
Dr. JOHN ZAKI 44
Dr. JOHN ZAKI 45
Dr. JOHN ZAKI 46
Dr. JOHN ZAKI 47
AUTOSCALING GROUP
At this stage, we should start creating an autoscaling
group. However we, will need a load balancer according to
our architecture. We could create the load balancer from
inside the autoscaling ….
However, let’s go to see the load balancing options first……
Dr. JOHN ZAKI 48
Dr. JOHN ZAKI 49
Dr. JOHN ZAKI 50
Dr. JOHN ZAKI 51
Dr. JOHN ZAKI 52
Dr. JOHN ZAKI 53
Dr. JOHN ZAKI 54
Dr. JOHN ZAKI 55
Dr. JOHN ZAKI 56
Dr. JOHN ZAKI 57
Dr. JOHN ZAKI 58
Dr. JOHN ZAKI 59
Dr. JOHN ZAKI 60
Dr. JOHN ZAKI 61
Dr. JOHN ZAKI 62
Dr. JOHN ZAKI 63
Dr. JOHN ZAKI 64
Dr. JOHN ZAKI 65
Dr. JOHN ZAKI 66
Dr. JOHN ZAKI 67
Dr. JOHN ZAKI 68
SUMMARY
01 CLOUDWATCH
02 LAUNCH TEMPLATES
03 ELASTIC LOAD BALANCING
04 TARGET GROUPS
05 AUTOSCALING
Dr. JOHN ZAKI 99
THANK
YOU
Dr. JOHN ZAKI 100