SlideShare une entreprise Scribd logo
1  sur  21
Auto scaling solution in AWS cloud

 Harish Ganesan       Raghuraman Balachandran
 Co Founder and CTO   Principal Engineer
 harish@8kmiles.com   raghu@8kmiles.com




                                  www.8kmiles.com
Objective

• Leveraging Auto Scaling and Elastic Load
  Balancing of AWS
• Cluster and Session replication not in scope
Understanding Scaling
  Infrastructure
  cost $$
                       Too much capacity


         Huge Cap-ex
                                                  You lost your
                                                  customers here

                                           Predicted Demand
                                           Actual Demand
                                           Scale up Approach
                                           Traditional scale out
                                           Automated scaling



Source: Amazon AWS                                     Time t

                                                 www.8kmiles.com
Auto Scaling Architecture
                                              User n
                                     User 2
                            User 1




                    Amazon Auto Scaling & Elastic Load Balancer      ELB redirects requests to same
                                                                     Web / APP server based on
                                                                     Session Sticky Algorithm




Autoscaled Web /
App servers        Web / App 1       Web / App 2       Web / App n       All the Auto Scaled
                                                                         Web/App Server s
                                                                         talk to the same
                                                                         DB machine



                                         My SQL
                                                                  www.8kmiles.com
Solution Components
• Elastic Block Storage (EBS) – server images
• Simple Storage Service (S3) – storing objects
  as key value pair
• Simple Queue Service (SQS) – queue
• Elastic Load Balancer (ELB) – load balancer
• AutoScale – for scaling servers up and down
  automatically
• SimpleDB – scalable database
                                      www.8kmiles.com
Solution Components - EBS
• Elastic Block Storage (EBS)
  – Amazon Elastic Block Store (EBS) provides block
    level storage volumes for use with Amazon EC2
    instances.
  – Amazon EBS is particularly suited for applications
    that require a database, file system, or access to
    raw block level storage.
  – Our Use case :Application executables ,
    configurations and OS are installed in the EBS in
    this reference architecture
                                          www.8kmiles.com
Solution Components – S3
• Simple Storage Service (S3)
  – Amazon S3 provides a simple web services
    interface that can be used to store and retrieve
    any amount of data, at any time, from anywhere
    on the web.
  – Our Use case : The files that are uploaded ,
    reports generated are stored in S3




                                         www.8kmiles.com
Solution Components – SQS
• Simple Queue Service (SQS)
  – Amazon Simple Queue Service (Amazon SQS)
    offers a reliable, highly scalable, hosted queue for
    storing messages as they travel between
    computers
  – Our Use case : the Meta data about the files are
    put on the queue for processing . The Background
    services picks up the meta data from SQS and
    accesess and processes the files from S3

                                           www.8kmiles.com
Solution Components – Simple DB
• Simple DB
  – Amazon SimpleDB is a highly available, scalable,
    and flexible non-relational data store that offloads
    the work of database administration. Developers
    simply store and query data items via web
    services requests
  – Our Use case : The Status , Audit and inter
    application information is stored in Simple DB



                                           www.8kmiles.com
Solution Components – ELB
• Elastic Load Balancer (ELB)
  – Elastic Load Balancing automatically distributes
    incoming application traffic across multiple
    Amazon EC2 instances.
  – Elastic Load Balancing detects unhealthy instances
    within a pool and automatically reroutes traffic to
    healthy instances until the unhealthy instances
    have been restored.
  – Our Use case : Load Distributed among Servers
    located in Multiple AZ and Dynamically Auto
    Scaled EC2 instances                   www.8kmiles.com
Solution Components – Auto Scaling
• Auto Scaling
  – Auto Scaling allows you to automatically scale
    your Amazon EC2 capacity up or down according
    to conditions you define.
  – Auto Scaling is particularly well suited for
    applications that experience hourly, daily, or
    weekly variability in usage.
  – Our Use case : EC2 Server instances dynamically
    Scaled up and Down depending upon the Load
    using the Auto scaling
                                        www.8kmiles.com
Setup and Config
Create an Elastic Load Balancer
          elb-create-lb my-load-balancer --headers --listener "lb-
          port=80,instance-port=8080,protocol=HTTP" --availability-zones us-
          east-1c




The load               App server port to         Add a name to your
balancer port          which requests needs       load balancer
                       to be forwarded



                                                                 www.8kmiles.com
Setup and Config contd..
Create a launch configuration
                 Just a name to the          AMI (server image) to be
                 launch config               launched during scaling


       as-create-launch-config my-launch-config --image-id ami-e3826c8a --
       instance-type m1.small --key my-key-pair --group my-security-group




     Instance                            Keypair and security
     (server) size                       Group (firewall) for
                                         the new servers
                                                                www.8kmiles.com
Setup and Config contd..
Create the auto scale group
                 Name your auto                    Min and Max number of
                 Scale group                       instances to be spawned



      as-create-auto-scaling-group my-as-group --availability-zones us-east-
      1c --launch-configuration my-launch-config --max-size 11 --min-size
      3 --cooldown 180 --load-balancers my-load-balancer




     Mention the launch                  Specify the load balancer to
     config (the one we                  which the new servers needs
     created in last step)               to be attached
                                                              www.8kmiles.com
… and we are done
Configure the triggers
                        Measure the avg CPU                 Specify the autoscale
                        of the autoscale group              group name


   as-create-or-update-trigger my-as-trigger --auto-scaling-group my-as-group
   --namespace "AWS/EC2" --measure CPUUtilization --statistic Average --
   dimensions "AutoScalingGroupName= my-as-group " --period 60 --lower-
   threshold 20 --upper-threshold 80 --lower-breach-increment"=-2" --upper-
   breach-increment 4 --breach-duration 180




                                                 Scale down by 2 servers and
  Lower CPU limit is 20% and
                                                 scale up by 4 servers
  upper CPU limit is 80%
                                                               www.8kmiles.com
Use Case – Demo Application
• Image 1: Servers at initial Stage
• Image 2: Load Increases : Servers are ramped
  up using Auto Scaling
• Image 3: Load Decreases
• Image 4: Servers are dynamically scaled down
  using Auto Scaling

  Demo screenshots attached in coming slides


                                               www.8kmiles.com
Image 1 : Initial Stage




                          www.8kmiles.com
Image 2 : Load Increase




                          www.8kmiles.com
Image 3 : Load Decrease




                          www.8kmiles.com
Image 4 : Scale down the Servers




                             www.8kmiles.com
Thank You
India
8KMiles Web Services
8KMiles.com

India
raghu@8kmiles.com
+91 – 988 422 4124

USA
paddy@8kmiles.com
1-408-647-1217




                       www.8kmiles.com

Contenu connexe

Plus de 8KMiles Software Services

Plus de 8KMiles Software Services (10)

Building SaaS products with Windows Azure
Building SaaS products with Windows Azure Building SaaS products with Windows Azure
Building SaaS products with Windows Azure
 
APAC Webinar Apr 10 - Architecting your Mobile App for the Cloud
APAC Webinar Apr 10 - Architecting your Mobile App for the CloudAPAC Webinar Apr 10 - Architecting your Mobile App for the Cloud
APAC Webinar Apr 10 - Architecting your Mobile App for the Cloud
 
Are you game for Cloud?
Are you game for Cloud?Are you game for Cloud?
Are you game for Cloud?
 
Preparing your IT infrastructure for thanksgiving
Preparing your IT infrastructure for thanksgivingPreparing your IT infrastructure for thanksgiving
Preparing your IT infrastructure for thanksgiving
 
8KMiles Cloud Solutions
8KMiles Cloud Solutions8KMiles Cloud Solutions
8KMiles Cloud Solutions
 
Hollywood asks "Are you ready for Cloud?"
Hollywood asks "Are you ready for Cloud?"Hollywood asks "Are you ready for Cloud?"
Hollywood asks "Are you ready for Cloud?"
 
Are you prepared for Viral Success?
Are you prepared for Viral Success?Are you prepared for Viral Success?
Are you prepared for Viral Success?
 
Avoid Embarrassment, Use Cloud
Avoid Embarrassment, Use CloudAvoid Embarrassment, Use Cloud
Avoid Embarrassment, Use Cloud
 
Monitoring on Amazon AWS Cloud
Monitoring on Amazon AWS Cloud Monitoring on Amazon AWS Cloud
Monitoring on Amazon AWS Cloud
 
8KMiles Cloud Services on AMAZON AWS
8KMiles Cloud Services on AMAZON AWS8KMiles Cloud Services on AMAZON AWS
8KMiles Cloud Services on AMAZON AWS
 

Dernier

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Dernier (20)

Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

AutoScaling on Amazon AWS

  • 1. Auto scaling solution in AWS cloud Harish Ganesan Raghuraman Balachandran Co Founder and CTO Principal Engineer harish@8kmiles.com raghu@8kmiles.com www.8kmiles.com
  • 2. Objective • Leveraging Auto Scaling and Elastic Load Balancing of AWS • Cluster and Session replication not in scope
  • 3. Understanding Scaling Infrastructure cost $$ Too much capacity Huge Cap-ex You lost your customers here Predicted Demand Actual Demand Scale up Approach Traditional scale out Automated scaling Source: Amazon AWS Time t www.8kmiles.com
  • 4. Auto Scaling Architecture User n User 2 User 1 Amazon Auto Scaling & Elastic Load Balancer ELB redirects requests to same Web / APP server based on Session Sticky Algorithm Autoscaled Web / App servers Web / App 1 Web / App 2 Web / App n All the Auto Scaled Web/App Server s talk to the same DB machine My SQL www.8kmiles.com
  • 5. Solution Components • Elastic Block Storage (EBS) – server images • Simple Storage Service (S3) – storing objects as key value pair • Simple Queue Service (SQS) – queue • Elastic Load Balancer (ELB) – load balancer • AutoScale – for scaling servers up and down automatically • SimpleDB – scalable database www.8kmiles.com
  • 6. Solution Components - EBS • Elastic Block Storage (EBS) – Amazon Elastic Block Store (EBS) provides block level storage volumes for use with Amazon EC2 instances. – Amazon EBS is particularly suited for applications that require a database, file system, or access to raw block level storage. – Our Use case :Application executables , configurations and OS are installed in the EBS in this reference architecture www.8kmiles.com
  • 7. Solution Components – S3 • Simple Storage Service (S3) – Amazon S3 provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. – Our Use case : The files that are uploaded , reports generated are stored in S3 www.8kmiles.com
  • 8. Solution Components – SQS • Simple Queue Service (SQS) – Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between computers – Our Use case : the Meta data about the files are put on the queue for processing . The Background services picks up the meta data from SQS and accesess and processes the files from S3 www.8kmiles.com
  • 9. Solution Components – Simple DB • Simple DB – Amazon SimpleDB is a highly available, scalable, and flexible non-relational data store that offloads the work of database administration. Developers simply store and query data items via web services requests – Our Use case : The Status , Audit and inter application information is stored in Simple DB www.8kmiles.com
  • 10. Solution Components – ELB • Elastic Load Balancer (ELB) – Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. – Elastic Load Balancing detects unhealthy instances within a pool and automatically reroutes traffic to healthy instances until the unhealthy instances have been restored. – Our Use case : Load Distributed among Servers located in Multiple AZ and Dynamically Auto Scaled EC2 instances www.8kmiles.com
  • 11. Solution Components – Auto Scaling • Auto Scaling – Auto Scaling allows you to automatically scale your Amazon EC2 capacity up or down according to conditions you define. – Auto Scaling is particularly well suited for applications that experience hourly, daily, or weekly variability in usage. – Our Use case : EC2 Server instances dynamically Scaled up and Down depending upon the Load using the Auto scaling www.8kmiles.com
  • 12. Setup and Config Create an Elastic Load Balancer elb-create-lb my-load-balancer --headers --listener "lb- port=80,instance-port=8080,protocol=HTTP" --availability-zones us- east-1c The load App server port to Add a name to your balancer port which requests needs load balancer to be forwarded www.8kmiles.com
  • 13. Setup and Config contd.. Create a launch configuration Just a name to the AMI (server image) to be launch config launched during scaling as-create-launch-config my-launch-config --image-id ami-e3826c8a -- instance-type m1.small --key my-key-pair --group my-security-group Instance Keypair and security (server) size Group (firewall) for the new servers www.8kmiles.com
  • 14. Setup and Config contd.. Create the auto scale group Name your auto Min and Max number of Scale group instances to be spawned as-create-auto-scaling-group my-as-group --availability-zones us-east- 1c --launch-configuration my-launch-config --max-size 11 --min-size 3 --cooldown 180 --load-balancers my-load-balancer Mention the launch Specify the load balancer to config (the one we which the new servers needs created in last step) to be attached www.8kmiles.com
  • 15. … and we are done Configure the triggers Measure the avg CPU Specify the autoscale of the autoscale group group name as-create-or-update-trigger my-as-trigger --auto-scaling-group my-as-group --namespace "AWS/EC2" --measure CPUUtilization --statistic Average -- dimensions "AutoScalingGroupName= my-as-group " --period 60 --lower- threshold 20 --upper-threshold 80 --lower-breach-increment"=-2" --upper- breach-increment 4 --breach-duration 180 Scale down by 2 servers and Lower CPU limit is 20% and scale up by 4 servers upper CPU limit is 80% www.8kmiles.com
  • 16. Use Case – Demo Application • Image 1: Servers at initial Stage • Image 2: Load Increases : Servers are ramped up using Auto Scaling • Image 3: Load Decreases • Image 4: Servers are dynamically scaled down using Auto Scaling Demo screenshots attached in coming slides www.8kmiles.com
  • 17. Image 1 : Initial Stage www.8kmiles.com
  • 18. Image 2 : Load Increase www.8kmiles.com
  • 19. Image 3 : Load Decrease www.8kmiles.com
  • 20. Image 4 : Scale down the Servers www.8kmiles.com
  • 21. Thank You India 8KMiles Web Services 8KMiles.com India raghu@8kmiles.com +91 – 988 422 4124 USA paddy@8kmiles.com 1-408-647-1217 www.8kmiles.com