<@ULVA73B9P> Morning! I have a flow that creates 1...
# ask-marvin
e
@Marvin Morning! I have a flow that creates 1000s of tasks that in turn start flows with run_deployment. The top level flow runs on ECS work pool on a standard instance. When running this, the tasks run forever and flows never start. If I instead run the same flow with only 10 tasks, it works perfectly. The question becomes: where is the bottleneck, is it a Prefect Cloud limitation or something else?
m
Good morning! Let's try to figure out the bottleneck together. First, we need to determine your version of Prefect because the approach to solving this issue could vary between Prefect 2.x and 3.x. Please confirm your Prefect version, and I'll look into potential limitations or known issues that could be causing this bottleneck. If you're unsure of your version, you can typically find it by running
prefect version
in your command line. Once I have that information, I'll search the relevant documentation and GitHub issues for insights related to task scaling, Prefect Cloud limitations, or any ECS-specific considerations.
e
@Marvin Prefect 2.0
m
Based on the Prefect 2.0 documentation and the absence of relevant GitHub issues, here are a few key points and considerations for your scenario: 1. ECS Work Pool Considerations: - Using ECS for task execution can depend on whether you're using EC2 or Fargate. Fargate can simplify the setup but might introduce delays in spinning up tasks due to infrastructure setup time. It's generally quicker using EC2 for the ECS cluster. More details here. 2. Task Concurrency Limits: - Prefect 2.x supports task concurrency limits using tags. Each task can have tags for which you can set concurrency limits. If you have many tasks (like thousands) and they share tags with concurrency limits, Prefect might throttle the execution based on these limits, leading to some tasks taking longer to start. Learn about concurrency limits. 3. Cloud Limitations or Database Constraints: - Check external constraints like database connections or API rate limits, especially if your tasks interact with external systems that might have their own limitations. 4. Deployment Configuration: - Ensure that your deployment configurations are designed to scale. The documentation provides information on setting up deployments properly to handle different scenarios. See more about deployments. Given these insights, you should start by considering if there are any concurrency controls enforced within your Prefect setup or external services. Additionally, review the resource configurations and capacity of your ECS setup. If those don't resolve the issue, it might be beneficial to monitor cloud service metrics and task logs to identify specific bottlenecks.
r
I have the same problems
It seems to be Prefect Cloud API rate limits
Which tier do you use?
e
Free
r
Yes, you are rate limited
e
We see that explicitly sometimes, with the 429 status code, but in this case it just a matter of the tasks running forever. Could still be rate limiting, though
r
Yeah, I had the same experience
It is quite frustrating because we don't have any feedback and it is not clear whether the flow runs may start at some point
e
Yeah, really!
Have you switched to pro tier?