Answer the question
In order to leave comments, you need to log in
How to get rid of memory leak in Django+Celery bundle?
Django 1.7.7, Celery 3.1.17, supervisor, rabbitmq.
The problem is that the workers perform tasks, but the RAM is not freed.
Tried
CELERYD_TASK_TIME_LIMIT = 600,
CELERY_TASK_RESULT_EXPIRES = 360,
user 1066 0.0 7.9 214576 41716 ? S 16:09 0:10 project/manage.py celery beat -s project/celerybeat-schedule
user 1067 0.0 8.2 138876 43032 ? S 16:09 0:17 project/manage.py celeryd --concurrency=1
user 1068 0.0 7.0 258700 37012 ? Sl 16:09 0:11 project/manage.py celerycam --frequency=10.0
user 1090 0.0 13.0 250740 68220 ? S 16:09 0:13 project/manage.py celeryd --concurrency=1
Answer the question
In order to leave comments, you need to log in
You can set the parameter CELERYD_MAX_TASKS_PER_CHILD
so that the worker process is recreated once every certain number of completed tasks, in which case the memory will be cleared. But you clearly have memory leaks somewhere in your code, otherwise the workers would not eat up so much memory over time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question