I'm confused how/when Batch decides to spin up a n...
# ask-metaflow
w
I'm confused how/when Batch decides to spin up a new EC2 instance vs reusing the same one. In one of my steps I requested
cpu=64, memory=384_000, gpu=1
and it's correctly running that task on a
g3.16xlarge
instance (which has 64 vCPU, 488 GiB memory and 4 GPUs). I am expecting no other tasks to be scheduled on that instance since the core count is maxed out, but I see another 24 tasks (with
cpu=1, memory=4
) running on the same instance. What is going on?
1
a
that shouldn't be the case - were all the 25 tasks running at the same time on that instance?
w
yea.. it's confusing
image.png
a
the instance with 23 tasks has available CPU shares
are you sure it is also running the larger workload?
w
i went through the tasks and found the larger one.. it says it's running. I'm not sure why it's showing the memory as 250gb though:
a
can you locate this job from the AWS Batch console?
w
yup i see it in the batch console
a
and what are the resources set to?
w
image.png
a
did you set the memory requirement through the decorator or through CLI?
w
via the decorator.. although it's possible the code i'm looking at was updated and the SFNs weren't updated accordingly
in any case, i'm less concerned about the memory value
but confused about the multiple tasks thing.. since it's causing those DockerTimeout errors
a
the only other smoking gun would be the actual instance type that's running
w
Ok my bad, I didn't filter the tasks to the instanceId properly. Looks like what's happening is, after the large task finishes on the g3.16xlarge instance, all the smaller tasks get allocated on there before the instance terminates.
👍🏼 1