Hello Prefect family, We currently are using pref...
# ask-community
j
Hello Prefect family, We currently are using prefect cloud with an ECS agent. Jobs get submitted successfully, but the time between
submitted
and
running
is 30-45 seconds. I suspect there’s some polling interval, but I don’t know where this polling interval constant value lives in the Prefect Code to lower it. Any help on this would be great! Thanks
k
Hey @John T, I don’t believe the polling is on the Prefect side. When it hits submitted, it means the agent is deploying the infrastructure required to run the Flow. So that 30-45 seconds is on the ECS side spinning up the container. I believe this is mostly pulling down the image so if you use EC2 launch type, I think you can cache the image.
upvote 1
a
@John T as Kevin said, the overhead doesn’t come from Prefect but from Fargate - since this is a serverless execution environment, AWS has to first provision resources for your flow, that’s why it takes some time. Switching capacity provider from Fargate to EC2 (self-managed data plane) can reduce this latency, but introduces additional overhead in the sense that you need to maintain those EC2 instances and make sure you have enough compute capacity for your flows. So that’s the tradeoff you need to consider.
j
Ahhh, this makes so much sense. I’m going to talk to our infra engineer to see how our current set up is. Thanks again for the super quick reply. You two are the best!
🙌 2