What are the criteria for setting ec2 or fargate autoscaling policies?

0

I tried setting the policy to apply autoscaling.

However, it was difficult to apply without any data.

So, I roughly thought about it, I set it to the feeling that the cpu or memory is about 10% from the maximum, and the maximum task is about twice as good, and the cooldown time was added about 1 minute to the deployment time.

I set it like this, but I wonder if there are any reference materials or standards for setting the policy.

1 Answer
0
Accepted Answer

Hi,

This answer largely depends on

  1. The behavior of your specific application
  2. Your business needs

Going more into each of those

  1. The behavior of your specific application
  • How fast do you expect traffic increases to come in? (remembering that target tracking is reactive and triggers after the metric has gone up and triggered the Alarms). If there's going to be a 2x spike over 1 minute, you'll need lower scaling thresholds to be able to absorb the burst
  • How long is the startup time of the application? More startup time means less ability to handle traffic increases
  • Is the application able to stay stable when its at/near 100% CPU/Memory/etc? Or when stressed do issues start showing up earlier? If the later, you'll want to lower the thresholds to keep it from getting close to 100%
  1. Your business needs
  • Can you handle a few minutes of downtime/degraded performance while waiting to scale? Set a higher threshold to optimize towards cost savings as much as possible. If not and this is mission critical, probably best to opt for a slightly lower target
  • Is this hyper mission critical, and you need to be able to instantly handle the load from an AZ failure on remaining nodes/tasks? If so, you're not going to want a high target like 80%

I know the above is all fairly generic, but there isn't a 1 size fits all answer. Hopefully these questions gave you a path to start looking down to figure out what works best for you. Also remember that you can create multiple target tracking policies, and if the High usage alarm triggers on either, they can scale-out; but scale-in will only happen if all the target tracking policies want to scale-in at the same time

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions