AWS Batch limit number of instances
When using AWS Batch is there a way to limit the maximum number of EC2 instances that AWS Batch will have running at one time? Ideally, this would apply across all compute instances. Does AWS Batch enable this or are there other AWS services that can be combined with AWS Batch to allow us to achieve instance based limits?
An example would be say I am running AWS Batch for some workload. But I want AWS Batch to at most have 10 EC2 instances running. Is there somewhere that I can configure AWS Batch such that it will respect that limit on EC2 instances?
If I understand your question, you should be able to limit the number nodes when you're setting up a multi-node parallel job. >See #8 in multi-node parallel job definition.< This is per job, not across all EC2 instances.
I'm not aware of a convenient way to limit EC2 instances across an account without restrictions on users & services (e.g. simply disallowing creation as a policy).
Thank you for your response. I'm loooking more for limiting how many instances AWS Batch will create and run at a single time. Say I only want batch to have 10 instances maximum at a given time.
I've added this example to the main question
There is no direct configuration which can limit the number of instances. However you can configure Max vCPU in compute environment such that it can launch the instances upto required numbers only.
For example : Suppose you create a compute environment with instance type as m4.large ( it comes with 2vCPU and 8 GiB memory). Now if you set the MAX vCPU as 20 for this compute environment, so this compute environment can scale max upto 20 vCPU means 10 instances of type m4.large.
Thank you for responding and confirming that the direct configuration does not exist at the moment. I looked into the max vCPUs approach but it breaks down once we have instance types with differing amounts of vCPUs as that can no longer be a direct proxy to instance count.
Service Quota and Spot Instances vCPUsAccepted Answerdgallitelliasked 2 years ago
ec2 throttling and batch operationsevgeny55asked 2 months ago
AWS batch does not scale down EC2 instancesJacques Blomasked 3 months ago
AWS Batch limit number of instancesacrookes-feasked 18 days ago
Managed compute environment, launches m4 instead of m5Accepted Answerloolooasked 3 years ago
Is there a way to automate failure handling and retries when using Amazon SageMaker batch transform?Accepted AnswerEXPERTOlivier_CRasked 2 years ago
My usecase for AWS BatchAccepted AnswerAWS-User-4573028asked 18 days ago
Get total number of array workers inside of array jobyodiggityasked 4 months ago
Why are so few instances running with my AWS Batch Compute Environment config?FabreLambeauasked 2 months ago
Can I force each job to run on a dedicated instance?Accepted Answerepchavesasked 3 years ago