Reputation: 3282
I started exploring fargate in Amazon Web Service and it is working as expected.
Now when I try to apply different auto scaling policy, I couldn't get the difference between Step-Scaling and Target Tracking policy
I understand the step scaling policy is :
We specify MULTIPLE thresholds Along with different responses.
Threshold A - add 1 instance when CPU Utilization is between 40% and 50%
Threshold B - add 2 instances when CPU Utilization is between 50% and 70%
Threshold C - add 3 instances when CPU Utilization is between 70% and 90%
And so on and so on
(i.e) There are multiple thresholds
1) But I couldn't understand how the target tracking policy works?
2) Not sure about the difference between Step scaling and Target Tracking policy
Thanks,
Harry
Upvotes: 2
Views: 7545
Reputation: 1
Target Scaling is like asking your financial adviser analyze your budget and make purchase decision based on that. Step scaling is like asking your financial adviser analyze your actual need and make purchase decision based on that.
Upvotes: -1
Reputation: 2580
Difference between Auto-Scaling Policies in AWS Fargate (Step Scaling vs. Target Tracking)
Step scaling policies increase or decrease current capacity based on a set of scaling adjustments (known as step adjustments) that you specify. With Step scaling, you control the scaling adjustments.
See here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-autoscaling-stepscaling.html
With target tracking scaling policies, Amazon ECS creates and manages the CloudWatch alarms that trigger the scaling policy and calculates the scaling adjustment based on the CloudWatch metric and the target value that you specify. With Target Tracking, AWS controls the scaling adjustments automatically based on your targets.
With target tracking scaling policies, you select a CloudWatch metric and set a target value. Amazon ECS creates and manages the CloudWatch alarms that trigger the scaling policy and calculates the scaling adjustment based on the metric and the target value. The scaling policy adds or removes service tasks as required to keep the metric at, or close to, the specified target value.
https://docs.aws.amazon.com/AmazonECS/latest/userguide/service-autoscaling-targettracking.html
For example, if you set your Average CPU Utilization to 90%, Amazon ECS will adjust the number of tasks (starting or stopping tasks) to keep this target.
Note: This answer has been revised to more effectively target the question in the subject line for the benefit of future readers (instead of catering to the specific concerns of the asker).
Upvotes: 5
Reputation: 5995
I'd try and answer your questions.
- But I couldn't understand how the target tracking policy works?
Well, AWS creates the Cloudwatch alarm for you on basis of the target specified by you. It monitors the alarm and in the event of any alarm breach, tries to keep the metric near the target value by scaling in or scaling out. Additionaly, target tracking scaling policy also adjusts to the changes in the metric due to a changing load pattern.
- Not sure about the difference between Step scaling and Target Tracking policy
I'd go for a target tracking policy if I am sure that my scaling metric increases/decreases in proportion of the number of instances in the auto scaling group. On the other hand, if I'd want more fine grained control of the scaling in or scaling out I'd go for step scaling say for example I've a real time websocket application behind a load balancer (with least connection algorithm) and the average CPU utilization suddenly starts jumping over 80, I'd add maybe 3-4 instances so that all new connections get routed to my new instances and the other instances get a breather.
So if I understand correctly, in step scaling we need to specify the alarm range as I mentioned in the question but in target tracking, we need to specify one target value like 90 percent which indicates that it if the instances has 90 percent of CPU then it spans another one?
Yes that's correct. AWS ECS takes care of spawning another task/instance so that it keeps the metric under check.
It makes sure it maintains the 90 percent max CPU in all the instances Say if my target value is 90 percent?
No, it doesn't make sure that if your target value is 90 percent, all the instances will be under 90 percent CPU. A target value is usually an average metric over all the instances in your scaling group. You can define your own metrics but that should be compatible with the target tracking policy. You can find more about that here (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html).
Upvotes: 2