How to put a rate limit on a celery queue?

后端 未结 3 1691
无人共我
无人共我 2021-01-01 09:50

I read this in the celery documentation for Task.rate_limit:

Note that this is a per worker instance rate limit, and not a global rate limit.

3条回答
  •  囚心锁ツ
    2021-01-01 10:52

    You can set this limit in the flower > worker pane. there is a specified blank space for entering your limit there. The format that is suggested to be used is also like the below:

    The rate limits can be specified in seconds, minutes or hours by appending “/s”, >“/m” or “/h” to the value. Tasks will be evenly distributed over the specified >time frame.

    Example: “100/m” (hundred tasks a minute). This will enforce a minimum delay of >600ms between starting two tasks on the same worker instance.

提交回复
热议问题