Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech Talks

2.239 Aufrufe

Veröffentlicht am

Learning Objectives:
- How and when to use step scaling policies
- How to use target tracking scaling policies
- How to use scaling policies for dynamic scaling and EC2 fleet management

  • Als Erste(r) kommentieren

Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech Talks

  1. 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Andre Dufour, AWS Automation and Messaging November 6, 2017 Set it and Forget it: Auto Scaling TargetTracking Policies
  2. 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Auto Scaling groupAuto Scaling group Fleet management Dynamic Scaling Elastic Load Balancing EC2 instances Elastic Load Balancing EC2 instances What is Auto Scaling? CPU utilization
  3. 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Dynamic scaling
  4. 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Dynamic scaling policy types Simple scaling — single scaling adjustment Step scaling — adjustment depends on size of alarm breach Target tracking scaling — target value for a specific metric
  5. 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target tracking scaling policies Set it and forget it Simplicity Speed
  6. 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target tracking in action: scaling out ELB EC2 Instances Traffic 5 10 15 20 25 30 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% Instances CPU Target Utilization CPU Utilization Instances Traffic Time
  7. 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Setting up target tracking scaling policies
  8. 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Horizontally scalable applications use cases - Load balanced applications - Batch data processing applications
  9. 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Load-balanced applications ELB Auto Scaling group Availability Zone A Availability Zone B Load Balancing Layer Compute Layer Data Layer DynamoDB CPU
  10. 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target tracking a load-balanced application: Step 1: Picking the metric - Application Load Balancer Request Count perTarget - Average CPU Utilization
  11. 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target tracking a load-balanced application: Step 2: Setting the target How many requests can you handle per instance? How quickly do your EC2 instances launch before they start receiving traffic? How fast does the traffic ramp?
  12. 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Batch data processing applications Availability Zone A Availability Zone B Producer Consumer … EC2 Instance Queue Simple Queue Service Requests Auto Scaling group
  13. 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. = 𝑄𝑢𝑒𝑢𝑒 𝑆𝑖𝑧𝑒 (𝐴𝑝𝑝𝑟𝑜𝑥𝑖𝑚𝑎𝑡𝑒𝑁𝑢𝑚𝑏𝑒𝑟𝑂𝑓𝑀𝑒𝑠𝑠𝑎𝑔𝑒𝑠𝑉𝑖𝑠𝑖𝑏𝑙𝑒) 𝐹𝑙𝑒𝑒𝑡 𝑆𝑖𝑧𝑒 (𝑅𝑢𝑛𝑛𝑖𝑛𝑔 𝐶𝑎𝑝𝑎𝑐𝑖𝑡𝑦 𝑜𝑓 𝑡ℎ𝑒 𝑓𝑙𝑒𝑒𝑡) Backlog Per Capacity Unit © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target tracking a batch data processing application: Step 1: Creating a custom metric
  14. 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target tracking a batch data processing application: Step 2: Setting a target = 𝐴𝑐𝑐𝑒𝑝𝑡𝑎𝑏𝑙𝑒 𝑀𝑒𝑠𝑠𝑎𝑔𝑒 𝑃𝑟𝑜𝑐𝑒𝑠𝑠𝑖𝑛𝑔 𝐿𝑎𝑡𝑒𝑛𝑐𝑦 𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝑇𝑖𝑚𝑒 𝑡𝑜 𝑃𝑟𝑜𝑐𝑒𝑠𝑠 𝑎 𝑀𝑒𝑠𝑠𝑎𝑔𝑒 Acceptable Backlog per Capacity Unit © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  15. 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Processing SLA = 10 Seconds Processing time per message = 0.1 seconds Acceptable backlog = 10/0.1 = 100 messages TARGET = 100 messages Target tracking a batch data processing application: Example
  16. 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target = 100 messages Queue size = 1000 Fleet size = 10 Actual backlog per capacity unit = 1000/10 = 100 Target =Actual  No scaling action Target tracking a batch data processing application: Example continued
  17. 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Target = 100 messages Queue size = 1500 Fleet size = 10 Actual backlog per capacity unit = 1500/10 = 150 Target < Actual  Auto Scaling adds 5 instances Queue size = 1500 Fleet size (new) = 15 Actual backlog per capacity unit = 1500/15 = 100 Target = Actual  No scaling action Target tracking a batch data processing application: Example continued
  18. 18. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Other best practices
  19. 19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Setting the min/max size of the Auto Scaling group Max Cost you’re willing to incur for the application Enough capacity to support peak load Min 2-3 EC2 instance per ASG balanced across AZs to ensure 100% up time
  20. 20. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Auto Scaling group EC2 instances have longer bootstrapping times Use scheduled scaling Recurring scaling events Schedule individual events ELB EC2 instances Scaling event Scaling event
  21. 21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Onboarding with dynamic scaling Analyze historical trends Choose the lower end of the range Adjust as the application becomes more mature
  22. 22. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Application Auto Scaling for other services Fleet EMR Instance Group ScalableTarget Scalable Dimension Service TasksECS Spot Fleet Request Spot InstancesEC2 Spot Fleet AppStream 2.0 EMR Core nodes Task nodes AppStream Instances Tables and Global Secondary Indices (GSI) Provisioned CapacityDynamoDB
  23. 23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo
  24. 24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Questions?
  25. 25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What are you Scaling? #smoothscaling Twitter: @arwdufour
  26. 26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! aws.amazon.com/autoscaling/getting-started

×