EC2 Fleet configuration strategies - Amazon Elastic Compute Cloud

EC2 Fleet configuration strategies

An EC2 Fleet is a group of On-Demand Instances and Spot Instances. EC2 Fleet can also be a group of Capacity Blocks instances.

On-Demand Instances and Spot Instances

The EC2 Fleet attempts to launch the number of instances that are required to meet the target capacity that you specify in the fleet request. The fleet can comprise only On-Demand Instances, only Spot Instances, or a combination of both On-Demand Instances and Spot Instances. The request for Spot Instances is fulfilled if there is available capacity and the maximum price per hour for your request exceeds the Spot price. The fleet also attempts to maintain its target capacity if your Spot Instances are interrupted.

You can also set a maximum amount per hour that you’re willing to pay for your fleet, and EC2 Fleet launches instances until it reaches the maximum amount. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.

A Spot capacity pool is a set of unused EC2 instances with the same instance type and Availability Zone. When you create an EC2 Fleet, you can include multiple launch specifications, which vary by instance type, Availability Zone, subnet, and maximum price. The fleet selects the Spot capacity pools that are used to fulfill the request, based on the launch specifications included in your request, and the configuration of the request. The Spot Instances come from the selected pools.

An EC2 Fleet enables you to provision large amounts of EC2 capacity that makes sense for your application based on number of cores or instances, or amount of memory. For example, you can specify an EC2 Fleet to launch a target capacity of 200 instances, of which 130 are On-Demand Instances and the rest are Spot Instances.

Capacity Blocks instances

Capacity Blocks for ML allow you to reserve GPU instances on a future date to support you short duration machine learning (ML) workloads. Instances that run in a Capacity Block are automatically placed close together inside Amazon EC2 UltraClusters. For more information about Capacity Blocks, see Capacity Blocks for ML.

Use the appropriate configuration strategies to create an EC2 Fleet that meets your needs.