Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech Talks
-
Upload
amazon-web-services -
Category
Documents
-
view
400 -
download
3
Transcript of Set it and Forget it: Auto Scaling Target Tracking Policies - AWS Online Tech Talks
© 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 Target Tracking Policies
© 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Dynamic scaling
© 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Target tracking scaling policies
Set itand forget it
Simplicity
Speed
© 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%
Inst
ance
s
CP
U
Target Utilization CPU Utilization Instances
Traf
fic
Time
© 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Horizontally scalable applications use cases
- Load balanced applications
- Batch data processing applications
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Load-balanced applications
ELB
Auto Scaling group
AvailabilityZone A
AvailabilityZone B
Load Balancing Layer
Compute Layer
Data Layer DynamoDB
CPU
© 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 per Target
- Average CPU Utilization
© 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?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Batch data processing applications
AvailabilityZone A
AvailabilityZone B
Producer
Consumer
…
EC2 Instance
Queue Simple Queue Service
Requests
Auto Scaling group
© 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
© 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.
© 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
© 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
© 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
© 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
© 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Auto Scaling group
EC2 instances have longer bootstrapping timesUse scheduled scaling
Recurring scaling events
Schedule individual events
ELB
EC2 instances
Scaling event
Scaling event
© 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Application Auto Scaling for other services
Fleet
EMR Instance Group
Scalable Target Scalable Dimension
Service TasksECS
Spot Fleet Request Spot InstancesEC2 Spot Fleet
AppStream 2.0
EMRCore nodesTask nodes
AppStream Instances
Tables and Global Secondary Indices (GSI)
Provisioned CapacityDynamoDB
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Questions?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What are you Scaling? #smoothscaling
Twitter: @arwdufour
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!aws.amazon.com/autoscaling/getting-started