allocation Strategy
Parameters
The allocation strategy to use for the compute resource if not enough instances of the best fitting instance type can be allocated. This might be because of availability of the instance type in the Region or Amazon EC2 service limits . For more information, see Allocation strategies in the AWS Batch User Guide . When updating a compute environment, changing the allocation strategy requires an infrastructure update of the compute environment. For more information, see Updating compute environments in the AWS Batch User Guide . BEST_FIT
is not supported when updating a compute environment.
This parameter isn't applicable to jobs that are running on Fargate resources, and shouldn't be specified.
BEST_FIT (default) - AWS Batch selects an instance type that best fits the needs of the jobs with a preference for the lowest-cost instance type. If additional instances of the selected instance type aren't available, AWS Batch waits for the additional instances to be available. If there aren't enough instances available, or if the user is reaching Amazon EC2 service limits then additional jobs aren't run until the currently running jobs have completed. This allocation strategy keeps costs lower but can limit scaling. If you are using Spot Fleets with
BEST_FIT
then the Spot Fleet IAM role must be specified.BEST_FIT_PROGRESSIVE - AWS Batch will select additional instance types that are large enough to meet the requirements of the jobs in the queue, with a preference for instance types with a lower cost per unit vCPU. If additional instances of the previously selected instance types aren't available, AWS Batch will select new instance types.
SPOT_CAPACITY_OPTIMIZED - AWS Batch will select one or more instance types that are large enough to meet the requirements of the jobs in the queue, with a preference for instance types that are less likely to be interrupted. This allocation strategy is only available for Spot Instance compute resources.
SPOT_PRICE_CAPACITY_OPTIMIZED - The price and capacity optimized allocation strategy looks at both price and capacity to select the Spot Instance pools that are the least likely to be interrupted and have the lowest possible price. This allocation strategy is only available for Spot Instance compute resources.
We recommend that you use
SPOT_PRICE_CAPACITY_OPTIMIZED
rather thanSPOT_CAPACITY_OPTIMIZED
in most instances. WithBEST_FIT_PROGRESSIVE
,SPOT_CAPACITY_OPTIMIZED
, andSPOT_PRICE_CAPACITY_OPTIMIZED
allocation strategies using On-Demand or Spot Instances, and theBEST_FIT
strategy using Spot Instances, AWS Batch might need to go abovemaxvCpus
to meet your capacity requirements. In this event, AWS Batch never exceedsmaxvCpus
by more than a single instance.