<@ULVA73B9P> can i specify deployment concurrency...
# ask-marvin
s
@Marvin can i specify deployment concurrency in prefect.yaml instead of passing it via cli
m
Yes, you can specify deployment concurrency in the
prefect.yaml
file. Prefect supports managing concurrency at the deployment level, allowing you to limit how many runs of a deployment can be active at once. The relevant fields you can use in your
prefect.yaml
are: - `concurrency_limit`: An integer that sets the maximum number of concurrent flow runs for the deployment. - `collision_strategy`: Configures the behavior for runs once the concurrency limit is reached. The default is
ENQUEUE
, which means new runs will transition to
AwaitingConcurrencySlot
and execute as slots become available. Another option is
CANCEL_NEW
. For more details, you can refer to the Prefect deployment documentation. If you're interested in exploring more about Prefect's top-level API, you can find details such as
flow
,
task
, and
deploy
among others, which might be useful for your deployment configuration.
s
@Marvin is it available in Prefect 2.x
m
In Prefect 2.x, deployment concurrency is managed differently. While the Prefect 2.x documentation does mention global concurrency limits, it doesn't specify deployment concurrency directly within a
prefect.yaml
file. Instead, global concurrency limits can be managed using CLI commands like
prefect gcl create
to set limits, and other commands to update or delete them. For more information on managing concurrency in Prefect 2.x, you can refer to the global concurrency limits guide.