When using celery, Rabbitmq is used as the default backend, as well as for storing errors upon failure (which caused exceptions).
Each new task creates a new queue on the server, with thousands of tasks the broker can be overloaded with queues, and this will affect performance in negative ways.
Each queue in Rabbit will be a separate Erlang process, so if you plan to keep a lot of results at the same time, you may have to increase the Erlang process limit and the maximum number of file descriptors of your OS allows.
Old results will not be cleaned automatically, so we must tell the rabbit to do this.
Below is conf. the line dictates the time for the life of the Queue pace. The default is 1 day.
CELERY_AMQP_TASK_RESULT_EXPIRES = Number of seconds
OR. We can completely change the backend repository, and not do it with a rabbit.
CELERY_BACKEND = "amqp"
We can also ignore it:
CELERY_IGNORE_RESULT = True.
In addition, when ignoring the result, we can also save errors that were saved for later use, which means another queue for unsuccessful tasks.
CELERY_STORE_ERRORS_EVEN_IF_IGNORED = True.
I will not mark this question as an answer, expecting a better answer.
Rererences:
source share