AWS 自动缩放中的 'Health Check Grace Period' 和 'Default Cooldown' 如何工作?

How do 'Health Check Grace Period' and 'Default Cooldown' in AWS autoscaling work?

我一直在研究我的自动缩放组的配置,但我并不完全明白这两者是如何工作的。

亚马逊说 Health Check Grace Period 是指:

The length of time that Auto Scaling waits before checking an instance's health status. The grace period begins when an instance comes into service.

Default Cooldown指的是:

The number of seconds after a scaling activity completes before another can begin. This is also called the cooldown period. Learn more about cooldown periods.

所以想象一下,当 CPU 消耗超过 50% 并且 Health Check Grace Period = 300Default Cooldown = 100 时,我有一个横向扩展的规则。如果我在第 0 秒启动一个实例,AWS 检查扩展组的 CPU 消耗需要多长时间?而且,新实例启动需要多长时间?发射前的时间是否为 400 秒,而直到 CPU 再次检查该组的时间为 100 秒?谢谢

健康检查宽限期默认冷却时间是不同的概念。 健康检查宽限期适用于单个实例,而默认冷却时间适用于自动缩放组。

如果因为 CPU 超过 50% 而在第 0 秒启动一个实例,这个新实例将获得 300 秒的宽限期以恢复健康。如果 300 秒后健康,它将继续 运行,否则它将被终止。

如果 CPU 在第 100 秒时仍高于 50%,自动缩放组将启动一个新实例(最后一次缩放操作发生在 100 秒前 = 冷却时间)。因此,您问题的答案是 100 秒,直到启动新实例。

另请注意,默认情况下,Amazon EC2 Auto Scaling 在手动扩展活动(= 设置所需容量)期间不遵守冷却时间,并且如果实例变得不健康,Auto Scaling 组不会等待冷却时间在更换不健康的实例之前完成的时间。