Hi - does anyone know where i can the number of AP...
# prefect-cloud
r
Hi - does anyone know where i can the number of API requests i make towards the cloud server?
j
Last time I asked it wasn't available and I haven't been able to find any information about what even counts towards the limit It's becoming more of a requirement for us that we can figure this out so that we know when we're risking killing things in production 🤷
r
Okay, thank you 🙂 . I agree, it would be great to see whether we are close to breaching the API limit.
t
hey @Rasmus Berntsen -- attaching our rate limit documentation! @Joseph Thickpenny Ryan, along with any API calls from within your code, the creation of a task and or flow will count towards the flow, flow run, and task rate limits.
thank you 1
j
@Tess Dicker Is there any documentation about what parts of the code make what types of API calls? We're using the prefect client rather than making API calls directly so there's a layer of abstraction that is obviously useful for our code but makes any effort on our side to figure out where specific API calls are happening much more involved
I've also looked at the concurrency limits for the work pool and queues and everything reads that this is only set at the flow run level, so this has limited use if you have flows with many tasks I've looked at the tag based concurrency limit for tasks, but that stops more tasks moving into the
Running
state and still creates all the tasks at the same time so as far as I can tell doesn't actually stop us hitting the rate limit because all the creation events happen at the start (it might help us not hit the rate limit multiple times due to changes of state, but the actual creation events are still happening) Are there any other avenues I can try that would reduce simultaneous API hits (and therefore the rate limit)?
t
@Joseph Thickpenny Ryan Other than concurrency limits, you can attempt to adjust the environment variable that increases the max number of retries with a 429.
Let me gather some more info and follow up with a final response!
Ok so final confirmation that I've checked @Rasmus Berntsen @Joseph Thickpenny Ryan -- Rate limits are hit through the Create Task Run and Create Flow Run calls. You can see these in your logs as well. So, for example, if you have something that maps over a task / for loop / etc. each time it creates a task run it will count towards the rate limit. If you are hitting these and have attempted concurrency and retries, the best option is to then increase your rate limit, which comes with an account upgrade.
r
@Tess Dicker - okay - thank you for clarifying 🙂