Posted On: Nov 4, 2020
Starting today, you can proactively manage the EC2 Spot Instance lifecycle by using the new Capacity Rebalancing feature 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 Instance 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 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 Spot Instance receives the rebalance recommendation. You can then either manually terminate the existing 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 and the blog post, Capacity Rebalancing for EC2 Fleet, and Capacity Rebalancing for Spot Fleet. To learn more about EC2 Instance rebalance recommendations, please visit this page.
Amazon EC2 Auto Scaling helps you maintain application availability and allows you to automatically add or remove EC2 instances according to conditions that you define. You can use the fleet management features to maintain the health and availability of your fleet. EC2 Auto Scaling is available in all commercial and AWS GovCloud (US) Regions. For more information, visit the Amazon EC2 Auto Scaling documentation page.
Amazon EC2 Fleet and Spot Fleet simplify the provisioning of EC2 capacity across different EC2 instance types, Availability Zones, and purchase models (On-Demand, Reserved Instances, Savings Plans, and Spot) to optimize your application’s scalability, performance, and cost. To learn more about using EC2 Fleet, please visit this page. To learn more about using Spot Fleet, please visit this page.