Prevent too many tasks from running simultaneously using tags.
Running
state for tasks with a given tag.
Running
state.
If there are no concurrency slots available for any one of your task’s tags, it delays the transition to a Running
state
and instructs the client to try entering a Running
state again in 30 seconds
(or the value specified by the PREFECT_TASK_RUN_TAG_CONCURRENCY_SLOT_WAIT_SECONDS
setting).
PrefectClient
Python clientCommand | Description |
---|---|
create | Create a concurrency limit by specifying a tag and limit. |
delete | Delete the concurrency limit set on the specified tag. |
inspect | View details about a concurrency limit set on the specified tag. |
ls | View all defined concurrency limits. |
PrefectClient.orchestration.create_concurrency_limit
.
create_concurrency_limit
takes two arguments:
tag
specifies the task tag on which you’re setting a limit.concurrency_limit
specifies the maximum number of concurrent task runs for that tag.PrefectClient.delete_concurrency_limit_by_tag
, passing the tag:
PrefectClient.read_concurrency_limit_by_tag
, passing the tag:
To see all of your limits across all of your tags, use PrefectClient.read_concurrency_limits
.