0% found this document useful (0 votes)
11 views

ReportNotes Module10 YMNO

Note for Cloud computing in BUrmese

Uploaded by

Myat Noe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

ReportNotes Module10 YMNO

Note for Cloud computing in BUrmese

Uploaded by

Myat Noe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Report for Module 10 (Section1, 2 and 3)

Section 1 - Elastic Load Balancing

What is elastic load balancing

 High traffic မ ျားတဲ့ modern website တတွေက Users တတွေဆက


ီ သိနျား် တ ေါင်ျားမ ျားစွေ သန်တ ေါင်ျားမ ျားစွေ
တသ request တတွေကိို serve လို ်တ ျားရတယ်

 Service တ ျားတအ
ဲ့ ခေါ users တတွေလိုခ
ိ င်တဲ့ text တတွေ image တတွေ video တတွေ မမန်ဆန် ီျား reliable မြစ်တဲ့
way န ဲ့website တတွေ serve တ ျားရတယ်

 High demand တတွေ မ ျားလ ျားတ နအမျှ


ဲ့ Just one server is not enough. Demand တတွေကိို Meet
မြစ်ြိို We
ဲ့ start requiring additional servers for a fast and reliable manner.

 Elastic load balancing က AWS service တစ်ခိုမြစ် ီျားတတ ဲ့ ဝင်လ တဲ့ network traffic ကိို multiple
targets တတွေမြစ်တဲ့ EC2 instance, containers, IP address တတွေမ distribute လို ်တယ်.
Distribute လ ို်တ
် တ
ဲ့ နရ မ Single availability zone or multiple availability zone မြစ်နင
ိို တ
် ယ်.

 Elastic load balancing က ကိိုယရ


်ဲ့ application
ဲ့ ကိိုဝင်လ တဲ့ changing traffic တတွေတ ေါ်မူတည် ီျား
load balancer ကိိုလိုသ
ိ လိို scale up and scale down လို ်တ ျားတဲ့ service

 Most workload မ ျားလ တအ


ဲ့ ခ ိနမ
် သူက automatically scale up လို ်တ ျားတယ်

Types of Elastic load balancing

Three types ရိတယ်


1. Application load balancer
 သူက Application level Layer 7 of OSI model မ အလို ်လို ်တယ် Request ရ content
ဲ့
တ ေါ်အတမခ ခံ ီျားတတ ဲ့ Targets တတွေဆီ Trafficကိို route တ ျားသွေ ျားတယ်

 HTTP န ဲ့HTTPS traffic တတွေရ Advanced


ဲ့ load balancing အတွေက်ဆိို Ideal type မြစ်တယ်
Micro services တတွေ container တတွေလိိုမ ိ ျား Modern application architectures တတွေရ ဲ့
Delivery ကိို target ထ ျားတဲ့ Advanced request routing ကိို Provide လို ်တ ျားနိင
ို တ
် ယ်
 Latest socket layer တတွေ Transport security layers တတွေ Ciphers and Protocols
တတွေကိိုအခ ိနတ
် ိိုငျား် Ensure မြစ်တစတအ
ဲ့ တွေက် ကိိုယ်ဲ့ application security ကိိုမမင်တ
ဲ့ ျားတယ်

2. Network load balancer

 သူက Network transport layer OSI Model ရ Layer


ဲ့ 4 မ လို ်တယ်

 Protocol data တ ေါ်အတမခ ခံ ီျား Connections တတွေကိို Target ဆီ route လို ်တ ျားတယ် TCP UDP
Traffic တတွေအတွေက် တက င်ျားတယ်

 1 second မ သန်ျားတ ေါင်ျားမ ျားစွေ တသ Request တတွေကိို low latenciesမြစ်တအ င် Maintain


လို ်ထ ျား ီျား handle လို ်ထ ျားတယ်

 Sudden network traffic pattern တတွေကိို handle လို ်နင


ိို တ
် ယ်

3. Class load balancer


 သူက EC2 instance တတွေကက ျားထက Basic load balancing အတွေက်လို ်တ ျားတယ်
Application level တက network transport level တက မ လို ်တယ်

 HTTP HTTPS TCP SSL traffic သံျားို တဲ့ application ရ load


ဲ့ balancing ကိို support တ ျားတယ်
သူက Old generation ံိုစံမ ိ ျားမြစ်တယ် မြစ်နင
ိို ရ
် င် application load balancer န ဲ့network load
balancer သက်သက်သျားံို ြိို AWSက
ဲ့ recommendတ ျားတယ်

How Elastic Load Balancing Works


 ထမဆံျားို အတနန ဲ့Load balancer က clients ဆီကလ တဲ့ traffic တတွေကိိုလက်ခံတယ် ီျားတတ ဲ့ one
or more availability zone မ ရိတဲ့ သူregister လို ်ထ ျားတဲ့ Targets တတွေဆက
ီ ိို routes တတွေ
request လို တ ျားတယ်

 ကိိုယ်က load balancer တတွေကိို ဝင်လ တဲ့ traffic တတွေကိို accept တတ


ဲ့ နရ မ configure
လို ်လိိုရတယ်
ဲ့ လို ်တတ
ဲ့ နရ မ Listeners တစ်ခို ဒေါမမဟိုတ် more than one listeners ကိို
specify လို ထ ်ျား ီျား configure လို ်ထ ျားနိင
ို ်
 Listeners က connection requests တတွေကိို စစ်တဆျားတစ င်ကဲ့ ကည်တ
ဲ့ နတ process တစ်ခိုမြစ်တယ်
Listener တတွေကိို http protocol လိို port 80 လိိုမ ိ ျားတတွေန ဲ့configure လို ်ထ ျားတယ်

 အလ
ဲ့ ိိုမ ိ ျား load balancers န target
ဲ့ ဆီသွေ ျားတဲ့ connections အတွေက်လည်ျား protocol န ဲ့port
number ကိိုသျားံို ီျား configure လို ်ထ ျားတယ်

 Load balancer ကိို health check လို ်နင


ိို ြ
် ိိုအတွေ
ဲ့ က် configure လို ်ထ ျားလိိုရတယ်
ဲ့
Health check လို ်တ က register ယူသျားံို ထ ျားတဲ့ target တတွေရ health
ဲ့
အတမခအတနတက င်ျားမတက င်ျား တစ င်ကဲ့ ကည်တ
ဲ့ မြစ်တယ် အလ
ဲ့ ိိုလို ်တအ
ဲ့ တွေက် load balancer က
health မြစ်တနတဲ့ တက င်ျားတက င်ျား perform နိင
ို တ
် ဲ့ instances တတွေကိို request တတွေ ိနိ
ို ဲ့ င
ို မ
် ယ်

 တကယ်လိို load
ဲ့ balancerက unhealthy မြစ်တနတဲ့ target တတွေကိို တတွေွေ့ရတအ
ဲ့ ခေါ သူက အဒ
ဲ့ ီ target
ကိိုသွေ ျားတနတဲ့ traffic ကိိုရ ်လိိုက်တယ် အဒ
ဲ့ ီ target က မ န် ီျား healthy မြစ်တနမ load balancer က
traffic ကိိုမ န် ီျား route လို ်တ ျားတယ်

 Load balancer တတွေရ type


ဲ့ တ ေါ်မူတည် ီျား configure လို ်တဲ့ ံိုစံကမ ျားသွေ ျားမယ် Application န ဲ့
network load balancer မ ကိိုယက
် target group တတွေမ target တတွေကိို register
အရင်လို ်ထ ျားမယ် ီျားရင် အဒ
ဲ့ ီ target groupsတတွေဆက
ီ ိို traffic တတွေကိို route လို ်တ ျားတယ်

 Classic load balancer typeမ က load balancer နအတူ


ဲ့ instances တတွေကိို register လို ်တယ်

Elastic load balancing use cases

Use cases တတွေအမ ျားကကီျားထကမ Main cases တတွေကတတ ဲ့

1. High Availability

 အမမတမ်ျားလိိုလိို downtime နည်ျား ီျား Available မြစ်တစြိိုနဲ့ ဲ့ကိိုယ်ဲ့ applications တတွေအတွေက် fault
tolerance ိတ
ို က င်ျားတစြိိုသံ
ဲ့ ျားို နိင
ို တ
် ယ် သူက traffic တတွေကိို Availability zone အမ ျားကကီျားက
healthy targets အမ ျားအမ ျားမ balance ညီတအ င် distribute လို ်တ ျားထ ျားတအ
ဲ့ တွေက်မြစ်တယ်

 Availability zone တစ်ခိုက targets တတွေက unhealthy မြစ်တနမယ်ဆရ


ိို င် အဒ
ဲ့ ီ traffic တတွေကိို healthy
မြစ်တဲ့ တမခ ျား availability zoneက targets တတွေဆက
ီ ိို route လို ်တ ျားတယ် အဲ့ targets တတွေ healthy
မ န်မြစ်လ ရင် Automatically traffic တတွေကိိုမ န်စ ီျား အကိို route လို ်တ ျားတယ်
2. Containerized Support
 Elastic load balancing အတွေက် တက င်ျားမွေနတ
် ဲ့ container support ရိတယ်
Containerized application တတွေကိို အဒ
ဲ့ ီ ec2 instance တစ်ခတ
ို ည်ျားတူတူမ ports
အမ ျားကကီျားကတနတစ်ဆင်် ဲ့ auto load balance တ ျားြိူအတွေ
ဲ့ က် load balancer ကိိုသျားံို နိင
ို တ
် ယ်

 Amazon Elastic container serverကိို ထထဝင်ဝင် intergate လို ် ီျားတတ ဲ့ သူတ ျားတဲ့ အကိုန ်
စီစဥ်ထ ျား ီျားသ ျား container offering လိိုမ ိ ျား အက ိ တက ျားဇူျားတတွေရိနင
ိို ်

 ကိိုယ်လို ်ြိိုလိ
ဲ့ ိုတ က service တစ်ခက
ို ိို load balancer သံျားို ီျား register လို ်ရို ံ Amazon ec 2က အဲ့
registration တတွေကိို manage လို ်တ ျားတယ် dock containers တတွေရ deregistration
ဲ့ ကိို ေါ လို ်တ ျား
တယ်

 Load balancerက auto အတနန ဲ့portတတွေကိို detectလို ်တ ျားတယ် သူဘ သူ configure မ န်လို ်တ ျား
သွေ ျားတယ် တမခ ျား use csaes တတွေအမ ျားကကီျားလည်ျားရိနင
ိို ် ေါတယ်

Load balancer monitoring


 Load balancer တတွေ traffic တတွေကိို monitor လို ်နင
ိို တ
် န
ဲ့ ည်ျားလမ်ျားတတွေရိတယ် load balancer တိူ ဲ့
target တတွေရ issues
ဲ့ တတွေကိိုတမြရင်ျားြိူရဲ့ တဲ့ န ်ျားလမ်ျားတတွေရိတယ်

 ထမတစ်ခိုက Amazon CloudWatch metricsကိိုသျားံို ရမယ် Elastic load balancing က ကိိုယရ


်ဲ့ load
ဲ့
balancers တတွေ target တတွေအတွေက် သူရ data
ဲ့ points တတွေကိို Amazon cloudwatch
ကိို ိတ
ို ဲ့ ျားလိိုက်တယ်

 CloudWatch ကအဒ
ဲ့ ီ datapoints တတွေကိို order စီထ ျားတဲ့ metrics တတွေမြစ်တဲ့ time series data
တတွေကိို statistics ံိုစံန ထို
ဲ့ တ်တ ျားတယ် ဒီ metrics တတွေကတနတစ်ဆင်ဲ့ ကိိုယ်က ကိိုယရ
်ဲ့ system
ဲ့
ကကီျားတကယ်တမ်ျား ထင်တအ
ဲ့ တိိုငျား် တက င်ျားတက င်ျားလို ်တနရလ
ဲ့ ျားဆိတ
ို ကိို အတည်မ ီျားစစ်လိူရတယ်
ဲ့

 ဥ မ အတနန ဲ့ကိိုယ်က ကိိုယ်သခ


ိ င်တဲ့ Specific metric တစ်ခိုကိို Monitoring လို ်တနြိိုအတွေ
ဲ့ က်
CloudWatch alarmတစ်ခိုကိို ြန်တျားီ လိိုရတယ်
ဲ့ ီျားရင် Action စ ီျားလို ်မယ် like email ကိို notification
ိတ
ို ဲ့ မ ိ ျားတတွေစလို ်လရတယ်
ိို ဲ့ တကယ်လိို metrics
ဲ့ က ကိိုယ်လက်ခံထ ျားတဲ့ အတိိုငျား် အတ တစ်ခိုထက
ိ ိို
တက ်သွေ ျား ီဆရ
ိို င် အဒ
ဲ့ ီ alarm က email လ ိလိ
ို ဲ့ ိုက်မယ်

 တကယ်လိို ကိ
ဲ့ ိုယ်ကကိိုယရ
်ဲ့ Load
ဲ့ balancers ကိိုလ လို ်တဲ့ requests တတွေရ detailed
ဲ့ info
တတွေကဘယ်လိိုတတွေလဆိတ
ို သိြိို Access
ဲ့ logs ကိိုသျားံို လိိုရတယ်
ဲ့ ီျားရင်အဒ
ဲ့ ေါကိို Amazon s3 မ log file
အတနနသိ
ဲ့ မ်ျားထ ျားလိိုရတယ်
ဲ့
 အဒ
ဲ့ ီ Access logsတတွေကိို Traffic patterns တတွေကိို Analyze လို ်ြိိုကိ
ဲ့ ိုယရ
်ဲ့ backend
ဲ့ applications
တတွေ Target တတွေရ issue
ဲ့ တတွေကိူအတမြရ ြိိုအတွေ
ဲ့ က်သျားံို လိိုရတယ်
ဲ့

 တန က်ဆျားံို တနန ဲ့AWS CLOUDTrailကိို Elastic cloud Balancing APIကိိုလ request တဲ့ callsတတွေရ ဲ့
detailed infoတတွေကိိုသရ
ိ ြိိုအတွေ
ဲ့ က်သျားံို လိိုရတယ်
ဲ့ ီျားရင် Amazon s3မ log file အတနန ဲ့store
ထ ျားတယ်

 CloudTrail logsတတွေကိို သံျားို ီျား ဘယ်သက


ူ ဒီ call ကိိုလို ်ခတ
ဲ့ လ ဘယ်လိို calls တတွေလ
ဘယ်အခ ိနမ
် လို ်ခတ
ဲ့ လဆိတ
ို callဘယ်တနရ ကလ လ သူရဲ့ IP
ဲ့ Address ကိိုဆျားံို မြတ်နင
ိို တ
် ယ်

-------------------------------------------------------
Section 2 - Amazon cloud watch
What is Amazon cloud watch?

 AWS ကိိုတက င်ျားတက င်ျား အက ိ ျားရိရိသျားံို နိင


ို ြ
် ိို AWS
ဲ့ resources တတွေန ဲ့ က်သက် ီျားသိရိြိိုလိ
ဲ့ ိုတယ်
For example, Amazon ec2 instancesတတွေကိိုဘယ်အခ ိနမ
် အသံျားို မ ရမလဆိိုတ ကိို
သိခ င်မသိလိမ်ဲ့မယ်
 ဒေါမမဟိုတ် application performance or availbility ကလံိုတလ က်တဲ့ capacity
မရိတ တကက င်လ
ဲ့ ျားဆိို တ ကိို သိြိိုလိ
ဲ့ ိုလ ီ
 ီျားရင် တကယ်တမ်ျား the whole infrastructure မ ကိိုယ်တကယ်တမ်ျားက ဘယ်တလ က် သံျားို တနလ
ဆိိုတ ကိို သိခ င်တအ
ဲ့ ခေါတတွေရိလ နိင
ို တ
် ယ်
 အဒ
ဲ့ ီ information တတွေသန
ိ င
ိို ြ
် ိို ဲ့captureလို ်နင
ိို ြ
် ိို အတွေ
ဲ့ က်ဆိို Amazon cloudwatch ကတနတစ်ဆင်ဲ့
ယူရမယ်
 CloudWatchဆိိုတ ကDevOps engineer တတွေ site reliability engineers တတွေရ use
ဲ့ of serviceကိို
observerလို ်နင
ိို တ
် ယ် Monitoringလို ်နင
ိို တ
် ယ်
 CloudWatch က ကိိုယ်ရ
ဲ့ AWS
ဲ့ resources တတွေ အခ ိနန
် တတမ
ဲ့ ျားညီ run တနတဲ့ applicationတတွေကိို
Monitor လို ်တ ျားတယ်
 ကိိုယ်ရ
ဲ့ resources
ဲ့ တတွေ applcations တတွေမ ကိိုယ်တိိုငျား် တ ခ င်တဲ့ အရ တတွေ အတ
ဲ့ တတွေက metrics
မြစ် ီျားတတ ဲ့ CloudWatch ကိိုသျားံို ီျားတတ မ
ဲ့ metrics တတွေကိို track လို ်လိိုရတယ်
ဲ့ collect
လို ်လိိုရတယ်
ဲ့
 ကိိုယ်က ကိိုယ်ရ
ဲ့ account
ဲ့ ထမ ကိိုယ် measure လို ်ခ င်တဲ့ any metric in ClodWatch အတွေက်
Alarm တစ်ခိုကိို create လို ်လိိုရတယ်
ဲ့
 အဒ
ဲ့ ီ Alarm ကိိုသျားံို ီျားတတ ဲ့ Amazon notification service တတွေ Amazon SNS တတွေကိို
အလိိုအတလ က် Notification တတွေ ိလိ
ို ဲ့ ိုရသလိို Amazon EC2 Auto Scaling action ဒေါမမဟိုတ် an
EC2 action ကိိုတိိုက်ရို ိက်လို ်ခ င်ရင်လည်ရတယ်

 ဥ မ အတနနဆိ
ဲ့ ိုရင် CloudWatch metric မ ကိိုယ်တိိုငျား် တ ခ င်တ က ဒေါတတွေလည်ျားမြစ်နင
ိို တ
် ယ်
EC2 instance CPU Utilization, Elastic Load Balancing request latency, Amazon
DynamoDB table throughput, Amazon Simple Queue Service queue length တတွေ even

charges on AWS bill တတွေဆိိုရင်သတ


ူ ိိုအတွေ
ဲ့ က် Alarm တတွေ create လို ်တ ျားရမယ်

 တကယ်လိို ကိ
ဲ့ ိုယ်ရ
ဲ့ ကိ
ဲ့ ိုယ် ိိုင ် apps တတွေ IT infrastructure တတွေအတွေက် ကိိုယ်ကိိုတိိုင ် specify

လို ်ထ ျားတဲ့ Custom metrics တတွေအတွေက်လည်ျား Alarm တစ်ခိုကိို create လို ်ထ ျားလိိုရတယ်
ဲ့

Amazon CloudWatch events

 Amazon CloudWatch events က ကိိုယ်ရ


ဲ့ AWS
ဲ့ cloud environment ထမ ဝင်လ တဲ့ events တတွေ

changes တတွေကိို လို ်တဆ င်ြိိုအတွေ


ဲ့ က် Targests တတွေဆီကိို events တတွေ route လို ်တ ျားတတ
ဲ့ နရ မ

rules တတွေကိိုသတ်မတ်တ ျားြိိုသံ


ဲ့ ျားို တယ်

 Targets တတွေမ ေါနိင


ို တ
် က Amazon EC2 instances, AWS Lambda functions, Kinesis

streams, Amazon ECS tasks, Step Functions state machines, Amazon SNS topics,
Amazon SQS queues and built-in targets within CloudWatch events.
 CludWatch events တတွေကoperational changes တတွေမြစ်လ ရင် aware ရိတယ် ဘ လိိုလ
ဲ့ ဆိတ
ို တ ဲ့

သူက မြစ်လ တဲ့ changes တတွေ မ န်လည်တံိုမ ဲ့ န်ရတယ် မန်ကန်တဲ့ လို ်တဆ င်သင်တ
ဲ့ ဲ့ actions

တတွေကိိုလိိုရင်လိိုသလိို တဆ င်ရွေက်ရတ မ ိ ျားတတွေရိ တယ်


 Amazon CloudWatch နဆိ
ဲ့ ိုရင် ကိိုယ်အ
ဲ့ တနန ဲ့system တစ်ခိုလံိုျားကိို overall အတနန ဲ့resources

တတွေဘယ်လိိုသျားံို လ application performance အတမခအတန တတွေ operationa health တတွေကိို

မမင်သ ထင်သ မမင်နင


ိို မ
် ယ်

 အဒ
ဲ့ ေါကိိုစသံျားို ြိို ဲ့cost တတွေဘ တတွေ တမခ ျားထ ် ီျား တ ျားစရ မလိိုဘျားို ကိိုယ်သျားံို သတလ က် တ ျားြိို လိ
ဲ့ ိုအ ်

တယ်

How to create CloudWatch alarm


 Cloud watch alarm ကိိုြန်တျားီ တတ
ဲ့ နရ မ ဒီ၃ခိုကိိုအတမခခံ ီျား ြန်တျားီ လိိုရတယ်
ဲ့ အဒ
ဲ့ ေါတတွေက static

threshold, an anomaly detection ီျားတတ ဲ့ a metric math expression မြစ်တယ်

 က်ိုယ်က CloudWatch alarmကိို static threshold တ ေါ်မ အတမခ ခံ ီျားြန်တီျားမယ်ဆိိုရင် အဒ


ဲ့ ီ alarm

အတွေက် CoudWatch metric တစ်ခိုကိိုတရွေ ျားခ ယ်ရမယ် ီျားရင် အဒ


ဲ့ ီ metric အတွေက် threshold

တစ်ခိုကိိုတရွေ ျားရမယ်

 အဒ
ဲ့ ီ metric က threshold ကိို breach ခ ိ ျားြ က်ဝင်တရ က်လိိုက်တအ
ဲ့ ခေါမ အဒ
ဲ့ ီ Alarm ကိို

အကမြတ်စစ်တဆျားခ ိနတ
် ခ ိ ွေ့အတွေက် trigger လို ်လိိုက်တယ်

ဥ မ အတနန ဲ့ကိိုယ်သတ်မတ်တ ျားရမ တတွေရိတယ်

 Namespace: Alarmတစ်ခိုကိိုလို ်တအ


ဲ့ ခေါမ namespace ေါရမယ် Namespace

ကကိိုယ်လိိုခ င်တC
ဲ့ loudWatch metric ကိိုတမ တ မြစ်တယ် ဥ မ ဆိရ
ို င် AWS/EC2

 Metric: Metric ဆိိုတ ကိိုယ်တိိုငျား် တ ခ င်တအ


ဲ့ ရ တစ်ခို variable ကိိုတမ တ ဥ မ CPU utilization

လိိုမ ိ ျားမြစ်တယ်

 Statistic: Statistic က average ဒေါမမဟိုတ် sum, minimum or maximum, sample count, a

predefined percentile, or custom တွေက်ထ ျားတဲ့ percentile တတွေလည်ျားမြစ်နင


ိို တ
် ယ်
 Period: Period က Alarm ကိို အကြတ်စစ်တဆျားြိိုအတွေ
ဲ့ က်သတ်မတ်ထ ျားတကဲ့ က ခ ိနတ
် စ်ခိုမြစ်တယ်

Alarm ကိို evaluateလို ်တနတအ


ဲ့ ခေါမ period တစ်ခိုစီကိူ data pointတစ်ခိုစီအမြစ်မ လို ်ထ ျားတယ်

 Condition: Static threshold တစ်ခိုအတွေက် conditionsတတွေကိိုသတ်မတ်တ ျားြိိုလိ


ဲ့ ိုတယ် ဥ မ

metric က thresholdထက် ိိုကကီျားတနတ မ ိ ျား greater and equal to မြစ်တနတအ


ဲ့ တမခအတနမ ိ ျား lower or

equal to ဒေါမမဟိုတ် ကိိုယ်တ ျားထ ျားတဲ့ threshold value ထက်ငယ်တနတ မ ိ ျားတတ်ွေ ဘယ်အတမခအတန

မဆိို သတ်မတ်လိိုရတယ်
ဲ့

 Additional configuration: တမခ ျား configure အတနန ဲ့information တတွေထ ် ီျားမ င်လိိုရတသျားတယ်
ဲ့

အမ
ဲ့ ဆိို Alarm ကိို trigger လို ်နင
ိို ြ
် ိို evaluation
ဲ့ လို ်တနတကဲ့ က ခ ိနအ
် တွေငျား် မ သူတက ်လွေနရ
် မယ်ဲ့

data point အတရအတွေက်န ဲ့ က်သက် ီျား ေါတယ် အဒ


ဲ့ ေါအမ င် CloudWatch အတနန ဲ့Alarmကိို evaluate

လို ်တနတအခ ိနမ


် missing မြစ်တနတဲ့ data တတွေကိိုဘယ်လိိုတမြရင်ျားမလ ဆိိုတဲ့ informationတတွေ

သတ်မတ်တ ျားရမယ်

 Action: တန က်ဆျားံို မ CloudWatch က လို ်ရမယ်ဲ့ သူactionတတွေ


ဲ့ ကိိုလည်ျား ကိိုယ်ကသတ်မတ်

တ ျားရမယ် Action တတွေမ ဆိို Amazon SNS topics ဆီကိို noti ိတ


ို ဲ့ မ ိ ျားတတွေ Amazon ec2 ရ auto
ဲ့

scaling action တတွေကိိုလို ်ခိိုကင်ျားတ မ ိ ျားတတွေ Amazon ec2 ရတမခ


ဲ့ ျား actions တတွေကိိုတိိုက်ရို ိက်

လို ်ခိိုငျား် တ မ ိ ျားတတွေရိမယ်

---------------------------------------------------------------------------------------------------------------------

Section 3 - Amazon EC2 Auto Scaling


Why scaling important?
 Scaling လို ်တယ်ဆိိုတ ကိိုယ်ရ
ဲ့ application
ဲ့ တတွေရ computing
ဲ့ capacity (storage တတွေ CPUတတွေ)

ဒေါမ ိ ျားတတွေကိို လိိုအ ်သလိိုအတိျားို အတလျှ မဲ့ လို ်နင


ိို တ
် ဲ့ Ability တစ်မ ိ ျားမြစ်တယ်
 Automatic scaling ကအတရျားကကီျားတယ်ဆိိုတ ကိို ဒီexample ကကည်ဲ့ ီျားသိနင
ိို တ
် ယ် Week တစ် week

လံိုျားမ လိိုအ ်တဲ့ Capacity တတွေကတစ်ရက်နတစ်


ဲ့ ရက်မတူဘျားူ အမမတမ င်ျားတနတယ် Workload မတူဘျားူ

ဒေါတကက င်က
ဲ့ ိိုယ်က Wednesday မ အရမ်ျား demandတတွေ workload တတွေမ ျားတ ကိို တမြရင်ျားြိိုအတွေ
ဲ့ က်

Capacity ကိိုလံိုျားဝအမမင်ဆ
ဲ့ ျားံို ထ ျားလိိုက်တယ်

 မ သန က တမခ ျားတနတတွေ
ဲ့ မ က Workloadတတွေ demand တတွေသိ ်မမ ျားတတ ဲ့ အဒ
ဲ့ ီ resource တတွေက

မသံျားို ဘထ ျားသလိိုမြစ်တနတယ် မလိိုအ ်ဘ သံျားို ထ ျားသလိိုမြစ်တနမယ် အက ိ ျားဆက်အတနန ဲ့

ကိုနက
် စရိတ်တတွေက မလိိုအ ် ကိုနလ
် မယ် တကယ်လိိုကိိုယ်က ကိုနက
် စရိတ်တတွေတလ ခ
ဲ့ င်လိို ဲ့

Capacity တတွေမ န်တလ မ


ဲ့ ယ်ဆိိုရင် Wednesday လိိုမ ိ ျား demand မ ျားတတ
ဲ့ နတတွေ
ဲ့ မ performance

တတွေလံိုျားဝတနျားသွေ ျားမယ်

 ဒီလိိုမ ိ ျားအတမခအတနမ ိ ျားမ လံိုျားဝအတက်အက မမငိမ်တဲ့ Workload တတွေအတွေက် capacity ကိို

automatically scale လို ်ြိိုလိ


ဲ့ ိုလ ီ Auto scaleမရိဘျားူ ဆိိုရင် ကိိုယ်ရ
ဲ့ application
ဲ့ ကမလိိုတအ
ဲ့ ခ ိနမ

Capacity တတွေသျားံို မိတ မ ိ ျားတတွေ လိိုတအ


ဲ့ ခ ိနမ
် Capacity တတွေလံိုလံိုတလ က်တလ က်မရိတမဲ့ သန တတွေ

မြစ်လ နိင
ို တ
ိ ယ် Users တတွေက ကိိုယ်ဲ့ app ကိိုသျားံို ရအဆင်မတမ နိင
ို ဘ
် ျားူ

Amazon EC2 Auto Scaling

 ဒေါ င်မယ်ဲ့ Cloud ကိိုသျားံို တအ


ဲ့ ခေါမ Computing power ဆိိုတ က program နမ ဲ့ လို ်ထ ျားတဲ့

resourceတစ်ခိုလိို ဒေါတကက င်ဲ့ Scaling လို ်တတ


ဲ့ နရ မ လံိုျားဝ flexible မြစ်တယ်

 Amazon EC2 auto scaling က AWS service တစ်ခိုမြစ်တယ် ကိိုယ်ဲ့ application ကိိုအမမ

available မြစ်တစြိိုအတွေ
ဲ့ က် လို ်တ ျားထ ျားတယ် EC2 instances တတွေကိို ကိိုယ်လိိုတဲ့ အတမခအတန

တိိုငျား် အတွေက် auto add လိိုရတယ်


ဲ့ remove လိရတယ်
ို ဲ့
 ဲ့
EC2 auto scalingရ fleet management feature ကိိုသျားံို ီျား ကိိုယ်ဲ့ fleet ရ availability
ဲ့ န ဲ့health

ကိိုတက င်ျားတက င်ျားထိနျား် ထ ျားလိိုရတယ်


ဲ့ Amazon ec2 auto scaling က ကိိုယ်ဲ့ application

ရလိ
ဲ့ ိုအ ်ခ က်တ ေါ်မူတည် ီျားတတ ဲ့ manual လို ်ထ ျားတဲ့ schedule အလိိုက် demand

တမ င်ျားရင်တမ င်ျားသလိိုမ ိ ျား Ec2 instances တတွေကိို add လို ်တ ျားတယ် remove လို ်တ ျားတယ်

 သူက Predictive scaling အတွေက် လည်ျား AWS auto scaling နတဲ့ ေါင်ျား ီျားသံျားို လိိုရတယ်
ဲ့

မမန်မမန်ဆန်ဆန်scale လို ်နင


ိို ြ
် ိိုအတွေ
ဲ့ က်ဆိို Dynamic scaling န ဲ့predictive scaling

၂ခိုကိိုတ ေါင်ျားသံျားို လိိုလည်


ဲ့ ျားရတယ်

 Automatic scaling က ခန်မဲ့ န်ျားလိိုရတ


ဲ့ ဲ့ workloads တတွေအတွေက်လည်ျား အသံျားို ဝင်တယ် ဥ မ ဆိိုရင်

Amazon မ weeklyအလိိုက် network traffic တတွေရိမယ် သူက November လကိုန ် Friday တတွေ

Monday တတွေ တကယ်ဲ့ US Retailor တတွေ အတရ င်ျားရဆံျားို အခ ိနတ


် တွေဆိိုရင် Traffic ကလံိုျားဝ peak

မြစ်သွေ ျားတယ်

 တကယ်ဆိို Amazon
ဲ့ ကသ အဒ
ဲ့ ီ မသံျားူ မ ျားဆံျားို အတမခအတနအတွေက် fixed capacity ကိိုသျားံို မယ်ဆိိုရင်

တမခ ျား အခ ိနတ


် တွေအတွေက် အဲ့ resource ရ 76%
ဲ့ ကလံိုျားဝ unused ံိုစံမ ိ ျားမြစ်သွေ ျားမယ်

Auto Scaling groups


 Auto scaling group ဆိတ
ို က EC2 instances တတွေကိိုစိုထ ျား ီျား logically group

စိုထ ျားတအ
ဲ့ ရ ကိိုတမ တ group ရ size
ဲ့ က ကိိုယ်လိိုခ င်တဲ့ capacity အတိိုငျား် configure လို ်ထ ျားတဲ့

instances အတရအတွေက်တ ေါ်မူတည်တယ်

 Demand တ ေါ်မူတည် ီျား manually or automatic scaling ကိိုသျားံို ီျားတတ ဲ့ size ကိိုညလ
ိ ိိုရတယ်
ဲ့

Auro scaling group တစ်ခိုစီမ အနည်ျားဆံျားို instances အတရအတွေက်ကိိုသတ်မတ်ထ ျားလိိုရတယ်


ဲ့ အဒ
ဲ့ ီ

size ထက်နည်ျားတဲ့ group တတွေမြန်တျားီ မိြိို ဲ့သတ်မတ်ထ ျားတ မြစ်တယ်


 ဒေါအမ
ဲ့ င် အမ ျားဆံျားို အတရအတွေက်ကိိုသတ်မတ်ထ ျား ီျားတတ ဲ့ အဒ
ဲ့ ီ limit ထက်တက ်သွေ ျားတဲ့ group

တတွေမလို ်မိတအ င်လို ်ထ ျားတ မြစ်တယ်

 ကိိုယ်က ကိိုယ်လိိုအ ်တဲ့ capacity ကိိုသတ်မတ်ထ ျားတယ်ဆိိုရင် scaling group တတွေကိိုြန်တီျား

တအ
ဲ့ ခေါတိိုငျား် မ Amazon ec2 scaling က အလိိုအတလ က် size ကိိုခ ိနည
် ိတ ျားတယ် အဒ
ဲ့ ေါဆိိုရင်

instances ရအတရအတွေ
ဲ့ က်တတွေကိိုသတ်မတ် ီျားသ ျားမြစ်သွေ ျားမယ်

 Auto scaling policies ကိိုြန်တီျားမယ်ဆိိုရင် Amazon ec2 auto scaling က application ရ Demand
ဲ့

မ ျားလ ရင် ဒေါမမဟိုတ်နည်ျားလ ရင် instances တတွေကိို launch ဒေါမမဟိုတ် Terminate တတွေလို ်တ ျား

သွေ ျားတယ်

 ဥ မ အတနန ဲ့auto scaling group မ instance 1ခိုကိို အနည်ျားဆံျားို ရိရမယ်ဲ့size အတနနထ


ဲ့ ျားမယ်

maximum အတနန ဲ့4ထိထ ျားထ ျားမယ်

 ဒေါဆိိုရင် ကိိုယ်သတ်မတ်ထ ျားတဲ့ criteria တတွေအတမခအတန တ ေါ်မူတည် ီျား ကိိုယ်သတ်မတ်ထ ျားတဲ့

minimum န ဲ့maximum ကက ျားထမ. instance အတရအတွေက်တတွေကိို လိိုအ ်သလိို scale

လို ်တ ျားသွေ ျားတယ်

Scaling out vs Scaling In

 Amazon ec2 ရ auto


ဲ့ scaling နဆိ
ဲ့ ိုရင် instances တတွေကိို launch action ကိိုလို ်တ က scaling

outမြစ် ီျားတတ ဲ့ Terminate လို ်တ က Scaling inလို ်တ မြစ်တယ်

How Amazon EC2 Auto Scaling works

 EC2 instances တတွေကိို launch လို ်ြိိုအတွေ


ဲ့ က် Auto scaling group က launch configuration

လိိုတခေါ်
ဲ့ တဲ့ configuration templateတစ်ခိုကိိုသျားံို တယ် Launch configuration ကိို create
လိိုက်တအ
ဲ့ ခေါမ ကိိုယ်က scaling လူ ်တအ
ဲ့ ခေါမ ဘယ် information instances တတွေကိိုအသံျားို မ မလ

ဆိိုတ သတ်မတ်တ ျားြိိုလိ


ဲ့ ိုတယ်

 ကိိုယ်သတ်မတ်ရမယ်ဲ့ information မ ဆိိုရင် AMI ရ ID


ဲ့ ေါဝင်ရမယ် instance type, IAM roles, one

or more security groups and any EBS volumes ဒေါမ ိ ျားတတွေလည်ျားသတ်မတ်ရမယ်

 တန က်တစ်ဆင်မ
ဲ့ Instances တတွေရ အနည်
ဲ့ ျားဆံျားို အမ ျားဆံျားို limit ကိိုသတ်မတ်ရမယ် ီျားရင် Auto

scaling group ရ လိ
ဲ့ ိုခ င်တဲ့ capacity ကိိုသတ်မတ်ရမယ် ီျားရင် VPC အတွေငျား် မ ရိတဲ့ Subnet

တစ်ခိုထမ launch လို ်လိိုက်တယ်

 Amazon EC2 Auto scalingက Elastic load balancing နတဲ့ ေါင်ျား ီျားတတ ဲ့ ရိ ီျားသ ျား auto scaling

group မ တစ်ခိုဒေါမမဟိုတ်တစ်ခိုထက် ိိုတဲ့ load balancers တတွေကိို attach လို ်ြိိုသံ


ဲ့ ျားို နိင
ို တ
် ယ်

 Attach လို ် ီျားရင် သူက instances တတွေကိို auto register လို ်တ ျားသွေ ျားတယ် ီျားတ နဝင်
ဲ့ လ တဲ့ traffic

တတွေကိို instances တတွေမ distribute လို ်လိုိက်တယ်

 တန က်ဆျားံို မ ဘယ်အခ ိနမ


် အဒ
ဲ့ ီ event ကိို scale လို ်မလသတ်မတ်တ ျားြိိုလိ
ဲ့ ိုတယ် တမခ ျား options

တတွေကိို scaling လို ်တတ


ဲ့ နရ မ ထည်သ
ဲ့ င
ွေ ျား် စဥ်ျားစ ျားြိိုလိ
ဲ့ ိုတယ် ကိိုယ်ကအခ ိနတ
် ိိုငျား် မ သတ်မတ်ထ ျားတဲ့

running instances တတွေကိို ထိနျား် သိများ် ထ ျားနိင


ို ြ
် ိို Auto
ဲ့ scaling group ကိို configure လို ်လိိုရတယ်
ဲ့

 ကိိုယ်က current instance levelတတွေကိိုထိနျား် ထ ျားခ င်ရင် Amazon ec2 ရ auto


ဲ့ scaling က auto

scaling groupမ runတနတဲ့ instances တတွေကိို ံိုမန် health check လို ်တ ျားတယ် တကယ်လိို ဲ့

unhealthy instance ကိိုတတွေွေ့မယ်ဆိိုရင် terminate လို ်လိုိက် ီျား instance ကိိုတမခ ျားအသစ်တစ်ခိုန ဲ့

အစ ျားထိျားို လိိုက်တယ်

 ကိိုယ်က Manual scaling ကိိုတရွေ ျားတယ်ဆိိုရင်Auto sclinga group ရကိ


ဲ့ ိုယ်လိိုခ င်တဲ့ capacity

ဒေါမမဟိုတ် အမ ျားဆံျားို အနည်ျားဆံျားို limit တတွေမ changes တတွေကိို သတ်မတ်တ ျားြိိုလိ


ဲ့ ိုတယ်
Scheduled ဆွေထ ျားတဲ့ Scaling နဆိ
ဲ့ ရ
ို င် Scaling functions တတွေက သတ်မတ်ထ ျားတဲ့ date တတွေ time

တတွေအတိိုငျား် auto perform လို ်တ ျားသွေ ျားမယ်

 ဒေါတကက င်ဲ့ predict လို ်လိိုရမယ်


ဲ့ ဲ့ workload တတွေအတွေက်ဆိို ကိိုယ်ကဘယ်အခ ိနမ
် instances

အတရအတွေက်ကိို တိျားို နိင


ို မ
် လ တလျှ န
ဲ့ င
ိို မ
် လ အတိအက သိတနတအ
ဲ့ ခေါမ ိ ျားမ ဆိိုရင် အသံျားို ဝင်တယ်

လစဥ်တနစဥ်
ဲ့ အ တ်စဥ် ဆိို ီျားအတိအက ထ ျားလိိုရနိ
ဲ့ ငို တ
် ယ်

 ိို ီျား အဆင်မဲ့ မင်မဲ့ မင်လ


ဲ့ ို ်ခ င်ရင် demand တ ေါ်မူတည် ီျား Dynamic scaling ကိို ကိိုယ်က parameters

တတွေသတ်မတ် ီျား resources တတွေအတွေက် configure လို ်လရတယ်


ိို ဲ့ ဒီ scaling process က scaling

policies တတွေသျားံို ထ ျားတယ်

 Demandတ ေါ်မူတည်တဲ့ Scaling ကScaling events တတွေအတွေက် Amazon cloudwatch ကိို CPU

Utilization တတွေ check ြိိုအတွေ


ဲ့ က် သံျားို လိိုရနိ
ဲ့ ငို တ
် ယ် ီျားရင် သူက cpu utilization အတွေက်ကကိ သတ်မတ်

ထ ျားတဲ့ threshold ကိိုတက ်သွေ ျားတအ


ဲ့ ခေါမ ိ ျားမ သ Scale လို ်တ ျားသွေ ျားတယ်

 ဒေါတကက င်ဲ့ တကယ်လိိုကိ


ဲ့ ိုယ်က condition တတွေဘယ်အခ ိန ် change နိင
ို မ
် လဆိိုတ ကိို မသိတအ
ဲ့ ခေါမ ဒီ

option ကအဒ
ဲ့ တ
ီ မ င်ျားတနတဲ့ condition တတွေမ scale လို ်နင
ိို ြ
် ိို ဲ့တတ ်တတ ်အသံျားို ဝင်တယ်

 တန က်ဆျားံို မ ကိိုယ်က capacity ကိို ကကိ တင်ခန်မဲ့ န်ျားလိိုရတ


ဲ့ ဲ့ demand အတမခအတနမ ိ ျားမ scale

လို ်ခ င်တယ်ဆိိုရင် Amazon ec2 auto scaling ကိိုသျားံို လိရတယ်


ို ဲ့

 ကကိ တင်ခန်မဲ့ န်ျားလိိုရတ


ဲ့ ဲ့ Scaling မြစ်ြိိုသူ
ဲ့ က EC2 ကိိုတကယ်သျားံို ထ ျားတဲ့ usage data တတွေ ကိိုအရင်

collect လို ်တယ် AWS က ကိိုယ်တိိုငတ


် တွေွေ့ ရိထ ျားတဲ့ billion ခ ီတဲ့ data points တတွေကိိုထ ်တ ေါင်ျား

အသံျားို မ ီျား predictive scaling အတွေက်သျားံို တယ်


 အဒ
ဲ့ တ
ီ န က်မ AWS က တသခ train ထ ျားတဲ့ machine learning models တတွေကိိုသျားံို ီျားတတ ဲ့

ကိိုယ်သခ
ိ င်တဲ့ traffic တတွေ တနစဥ်
ဲ့ အ တ်စဥ် အသံျားို မ တနတဲ့ EC2 usage pattern တတွေကိိုကကိ တင်

ခန်မဲ့ န်ျားလိိုရမယ်
ဲ့

 အဒ
ဲ့ ီ model က စ ီျားpredict လို ်နင
ိို ြ
် ိိုအတွေ
ဲ့ က် အနည်ျားဆံျားို historical data တစ်ရက်စ လိိုအ ်တယ်

ီျားရင် သူက every 24 hours ရ data


ဲ့ တတွေကိို evaluate လို ် ီျားတတ ဲ့ တတ က် 48 hours အတွေက်

မြစ်လ နိင
ို တ
် ခ တတွေကိိုြန်တီျားတ ျားတယ်

 Prediction process က EC2 instances တတွေကိို scaleြိို scaling


ဲ့ group 1ခို or အမ ျားကကီျားအတွေက်

ကိို Scaling plan ကိိုသက


ူ ထိုတ်တ ျားတယ်

Implementing dynamic scaling

 Dynamic scaling ကိို implement လို ်နင


ိို ြ
် ိိုအတွေ
ဲ့ က် အသံျားို မ ျားတဲ့ configuration 1ခိုက Ec2

instances န ဲ့load balancers ဆီက ရထ ျားတဲ့ information ကိိုအတမခ ခံထ ျားတဲ့ CloudWatch alarm

ကိို createလို ်တ ျားထ ျားြိိုမြစ်


ဲ့ တယ်

 တကယ်လိို Threshold
ဲ့ ကိိုခ ိ ျားတြ က်လိိုက် ီဆရ
ိို င် Cloud Watch alarm က Automatic scaling

event ကိိုတခေါ်လိိုက်တယ် ီျားရင် auto scaling grupo မ ရိတဲ့ ec2 instances တတွေကိို Scale in တတွေ

Scale out တတွေမ လို ်တယ်

 ဥ မ တမ ရရင် ကိိုယ်က ထမဆံျားို EC2 instances တတွေရ CPU


ဲ့ utilization ကိို monitor လို ်ြိို ဲ့

Amazon cloudwatch ကိို create လို ်တ ျားတယ် ီျားတ န ဲ့automatic scaling policies တတွေကိို

runတယ်
 တကယ်လိို fleet
ဲ့ တစ်ခိုလျားံို ရ ဲ့ မ်ျားမျှ CPU Utiluzation က 60% ကိို 5မိနစ်ထက် ိို ီျား တက ်သွေ ျား

မယ်ဆိိုရင် ec2 auto scaling က auto scaling group ကိူ Ec2 instance တစ်ခိုကိို

ကိိုယ်သတ်မတ်ထ ျားတဲ့ launch configuartion အတ ေါ်မူတည် ီျား ထ ်ထည်လ


ဲ့ ိိုက်တယ်

 ီျားရင် ec2 auto scaling က Auto scaling group ထကိို Ec2 insntace ကိိုထည်လ
ဲ့ ိိုက်ြိို သူ
ဲ့ က Elastix

load balancing ကိိုတခေါ်လိိုက်တယ် ီျားရင် load balancing ကလိိုအ ်တဲ့ health checks

တတွေမ လို ်တယ် ီျားတ န ဲ့health အဆင်တမ ရင် traffic ကိိုအဲ့ instance ဆီကိို distribute

လို ်လိုိက်တယ်

 Elastic load balancing က traffic ကိို EC2 instances ကက ျားထမ route လို ်တ ျား ီျားတတ ဲ့ Metric

တတွေကိို Amazon CloudWatch ကိို ိတ


ို ဲ့ ျားလိိုက်တယ်

AWS Auto Scaling

 AWS auto scaling ဆိတ


ို က ကိိုယ်ရ
ဲ့ application
ဲ့ ကိို monitor ြိိုလို
ဲ့ ်ထ ျားတဲ့ service

သက်သက်မြစ်တယ် သူက မြစ်နင


ိို တ
် အ
ဲ့ ထိ cost ကိို lowset အတနအထ ျားမ steady မြစ်တဲ့

performance မြစ်ြိို capacity


ဲ့ ကိိုလိိုအ ်သလိို ခ ိနည
် ိတ ျားတဲ့ service တစ်ခိုမြစ်တယ်

 ကိိုယ်အ
ဲ့ တွေက် အဒ
ဲ့ ီ service က ရိိုျားရင် ီျား တကယ်သျားံို နိင
ို တ
် ဲ့ user interface ကိိုတ ျားထ ျားတယ် အဒ
ဲ့ ီ

interface ကတနမ Amazon EC2 instances and Spot fleets, amazon elastic container

services, Amazon DynamoDB tables and indexes and Amazon Aurora replicas တတွေလိုိ

Resources တတွေအတွေက် scaling plan တတွေလို ်လိိုရတယ်


ဲ့

 ကိိုယ်ရ
ဲ့ Ec2
ဲ့ instances တတွေကိို dynamically scale လို ်ခ င်ရင် တမခ ျား AWS service တတွေအတွေက်

additional resources တတွေကိို scale လို ်ခ င်တ မ ိ ျားမ We can use Amazon EC2 auto scaling

service.

You might also like