扩展策略中的 AWS ASG 冷却期和预热期有什么区别?

What is the difference between AWS ASG cooldown period and the warmup period in the scaling policy?

AWS ASG 冷却时间(当我想更新我的自动扩展组时可以编辑)和扩展策略中的预热时间有什么区别?

冷却时间可防止失控缩放事件。如果您的系统在 CPU 上 运行 高并且您的自动缩放规则添加了一个实例,则需要 5 分钟左右的时间才能使实例完全启动并帮助加载。如果没有冷却时间,该规则将继续触发并可能在 CPU 指标下降之前添加 4 或 5 个实例,从而导致浪费的过度配置。或者在缩减的情况下,超调并导致供应不足。

with a cooldown period in place, the Auto Scaling group launches an instance and then suspends scaling activities due to simple scaling policies or manual scaling until the specified time elapses. (The default is 300 seconds.) This gives newly launched instances time to start handling application traffic. After the cooldown period expires, any suspended scaling actions resume. If the CloudWatch alarm fires again, the Auto Scaling group launches another instance, and the cooldown period takes effect again. If, however, the additional instance was enough to bring the CPU utilization back down, then the group remains at its current size.

Cooldown

实例预热

实例的预热值允许您控制新启动的实例可以为 CloudWatch 指标做出贡献之前的时间,因此当预热时间到期时,实例将被视为 Auto Scaling 组的一部分,并且将获得流量。

With step scaling policies, you can specify the number of seconds that it takes for a newly launched instance to warm up. Until its specified warm-up time has expired, an instance is not counted toward the aggregated metrics of the Auto Scaling group. While scaling out, AWS also does not consider instances that are warming up as part of the current capacity of the group. Therefore, multiple alarm breaches that fall in the range of the same step adjustment result in a single scaling activity. This ensures that we don't add more instances than you need.

as-scaling-target-tracking

我确定了两个关键差异和一个热身观察结果:

  • 预热仅适用于横向扩展
  • 冷却适用于缩小和缩小
  • 预热适用于所有扩展策略
  • 冷却时间仅适用于 simple scaling policies
  • warm-up 步进扩展策略仅禁止扩展它所遵循的实例数量
    • 按第一步缩放,从10->11会触发预热期
    • 在此期间,第一个范围内的指标可以完全忽略
    • 第二步中的指标,比如添加 3 个实例,只会触发添加 3-1 = 2 个实例,同时预热生效