<@ULVA73B9P> what mean concurrency limit in deploy...
# ask-marvin
d
@Marvin what mean concurrency limit in deployment Concurrency Limit Collision Strategy (Optional) Configure behavior for runs once the concurrency limit is reached. what mean Enqueue and Cancel new
m
thought for 50.9 seconds
To create or modify concurrency limits, you can use commands like: -
prefect gcl create
- Create a new concurrency limit -
prefect gcl update
- Modify an existing limit -
prefect gcl ls
- List all current limits -
prefect gcl inspect
- View details of a specific limit Remember that concurrency limits are not created implicitly - they need to be explicitly set up if you want to enforce them in your deployments.
n
@Marvin i think the question was about the meaning of collision strategies in deployment concurrency limits
🙏 1
m
thought for 40.7 seconds
Let me explain specifically about deployment concurrency limits and their collision strategies: ### Deployment Concurrency Limits When you set a concurrency limit on a deployment, you're specifying how many flow runs from that specific deployment can run at the same time. For example, if you set a limit of 3, only 3 instances of that flow can run simultaneously. ### Collision Strategies When a new flow run is triggered and you're already at the concurrency limit, Prefect needs to know what to do. This is where the collision strategies come in: 1. Enqueue - When selected: If you try to run a new flow when at the limit, the new run will be queued - The queued run waits in line and will start automatically when a running flow finishes - Think of it like a waiting list at a restaurant - when a table (slot) becomes available, the next person in line gets seated 2. Cancel New - When selected: If you try to run a new flow when at the limit, the new run will be cancelled immediately - No queuing occurs - it's simply rejected - Think of it like a "Sold Out" sign - once capacity is reached, new requests are turned away ### When to Use Each Strategy Choose Enqueue when: - All flow runs must eventually complete - Order of execution matters - Delayed execution is acceptable - Example: Processing customer orders where every order must be processed, even if delayed Choose Cancel New when: - Time-sensitive operations where delayed execution isn't useful - Real-time processing where stale data wouldn't be valuable - Resource management is critical - Example: Real-time monitoring where old data becomes irrelevant quickly This is specifically about deployment-level concurrency limits, which are different from global concurrency limits (GCLs) that I discussed in my previous response. These strategies help you manage resource usage and flow execution at the individual deployment level.