<@ULVA73B9P> How to decrease `rate_limit`manually?...
# ask-marvin
m
@Marvin How to decrease `rate_limit`manually? Background: I am using ETags with
If-None-Match
headers and the request only counts against the limit if the server doesn't return 304. However, I only know this after the api call
m
To manually decrease the
rate_limit
in Prefect, you can utilize concurrency limits with slot decay. This allows you to control how often tasks can run by adjusting the slot decay rate. Here's a brief overview of how you can manage this: 1. Slot Decay Configuration: - Each occupied slot becomes unavailable for other tasks until it refreshes based on the
slot_decay_per_second
parameter. - A higher decay rate (e.g., 5.0) means slots refresh quickly, allowing tasks to run more frequently with short pauses. - A lower decay rate (e.g., 0.1) means slots refresh slowly, resulting in less frequent task runs with longer pauses. 2. Management Options: - Through the UI: You can manage global concurrency limits in the Concurrency section of the Prefect UI. - Through the CLI: Use the Prefect CLI to manage concurrency limits. For example, you can create a new concurrency limit using the
prefect gcl create
command and specify a
--limit
. For more details, you can explore the Prefect documentation on global concurrency limits. Additionally, here is the top-level API of Prefect for your reference: -
__version__
,
allow_failure
,
aserve
,
deploy
,
flow
,
Flow
,
get_client
,
get_run_logger
,
pause_flow_run
,
resume_flow_run
,
serve
,
State
,
suspend_flow_run
,
tags
,
task
,
Task
,
Transaction
,
unmapped
. These components might help you in setting up and managing your workflows effectively.
m
This doesn't answer my question