How is rate_limit applied in celery?

I run the Django site where I use Celery to implement proactive caching — that is, I compute and cache the results even before the user requests them.

Nevertheless, one of my celery tasks could be called a lot in some situation (I would say that it is actually faster than usual). I would like to evaluate it so that it does not consume a lot of resources when it is actually not so useful.

However, I would like to first understand how the Celery attribute celery.task.base.Task.rate_limit is applied. Are the problems solved? Are they delayed and executed later?

Thanks in advance!

+6
source share
1 answer

Tasks with a limited restriction are never deleted, they are queued inside the worker, so they are executed as soon as they are allowed to run.

The marker token algorithm does not indicate anything about packet loss (this is an option, but Celery does not).

+16
source

Source: https://habr.com/ru/post/897991/


All Articles