Posted On: Nov 17, 2020
Starting today, you can manage Spot Interruptions proactively using the new Capacity Rebalancing for Amazon EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. Capacity Rebalancing helps you maintain workload availability by proactively augmenting your fleet with a new Spot Instances before a running instance receives a two-minute interruption notice. Previously, EC2 Auto Scaling, EC2 Fleet, and Spot Fleet replaced Spot Instances only after they were interrupted. Now, with Capacity Rebalancing, these services attempt to proactively replace Spot Instances when they receive the new EC2 Instance rebalance recommendation, rather than waiting until they receive a two-minute in interruption notice.
The EC2 Instance rebalance recommendation signal is a new feature that notifies you when a Spot Instance is at elevated risk of interruption. The signal can arrive sooner than the two minute Spot Instance interruption notice, giving you the opportunity to proactively rebalance your workload to new or existing Spot Instances that are not at elevated risk of interruption. If you enable Capacity Rebalancing with Amazon EC2 Auto Scaling, it will attempt to launch a replacement instance when an existing Spot Instance receives the rebalance recommendation. If the replacement Spot Instance is launched before the existing instance is interrupted, EC2 Auto Scaling will proceed to terminate the existing Spot Instance. You can enable or disable Capacity Rebalancing on an existing EC2 Auto Scaling group using the CLI, SDK, or the console.
Similarly, if you enable Capacity Rebalancing with EC2 Fleet or Spot Fleet, they will attempt to launch a replacement instance when an existing EC2 Spot Instance receives an EC2 Instance rebalance recommendation. You can then either manually terminate the existing EC2 Spot Instance when you’re ready (for example, after you finish any shutdown or checkpointing processes), or you can leave the instance running.
Together with Capacity Rebalancing, we recommend using the capacity optimized allocation strategy and a diversified set of instance types and Availability Zones. Additionally, when using EC2 Auto Scaling, we recommend configuring EC2 Instance terminating lifecycle hooks to gracefully perform any required shutdown procedures (for example, you can start checkpointing your work early to save as much state as possible before the instance is interrupted)
For more information, see Amazon EC2 Auto Scaling Capacity Rebalancing in the Amazon EC2 Auto Scaling User Guide, Capacity Rebalancing for EC2 Fleet and Capacity Rebalancing for Spot Fleet.
Amazon EC2 Fleet and Spot Fleet simplify provisioning of EC2 capacity across different EC2 instance types, Availability Zones, and purchase models (On-Demand, Reserved Instances, and Spot) to optimize your application’s scalability, performance and cost.