Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-celery warnings about settings.DEBUG

I have some questions regarding running djcelery.

When I run

python manage.py celeryd --setting=settings

The workers seem to have started but the warnings concern me:

C:\Python27\lib\site-packages\djcelery\loaders.py:86: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!

Googled for this warning message but no one seems to care about it. Should I be concerned?

Thanks a lot!

like image 774
airfang Avatar asked Dec 08 '11 06:12

airfang


2 Answers

It is what it says it is - a warning that settings.DEBUG should not be set for production deployments. If you're just using it for development, then it is not something to be concerned about. In general, this ought to apply whether you use django-celery or not.

I have not looked up the details, but as mentioned in this answer:

When DEBUG is enabled Django appends every executed SQL statement to django.db.connection.queries, this will grow unbounded in a long running process environment.

like image 58
Shawn Chin Avatar answered Nov 13 '22 18:11

Shawn Chin


The officially recommended way to start celeryd for django-celery is:

python manage.py celeryd --setting=settings

Today, I forgot this and directly start celeryd by

python -m celery.bin.celeryd --config=settings

and viola, no warnings! And it works just fine! The Celery group really need to work on their docs. Although it seems comprehensive, some key pieces are missing to cover all the grounds imho.

like image 35
airfang Avatar answered Nov 13 '22 19:11

airfang