How to put a rate limit on a celery queue?

后端 未结 3 1719
无人共我
无人共我 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:44

    hey I am trying to find a way to do rate limit on queue, and I find out Celery can't do that, however Celery can control the rate per tasks, see this:

    http://docs.celeryproject.org/en/latest/userguide/workers.html#rate-limits

    so for a workaround, maybe you can set up one tasks per queue(which makes sense in a lot of situations), and put the limit on task.

提交回复
热议问题