After several hours on this without results I really need an help.
I configured Django-Celery on my Django App and I'm able to run scheduled tasks with:
python manage.py celeryd -E -B -l INFO
Now it's time for production and it's here that my pain begins.
I configured celeryd
as daemon. It's seems working, but scheduled tasks won't run.
So I added -B
in the CELERYD_OPTS
.
My tasks now run as scheduled but I have this boring lines on my log:
[2014-02-17 22:37:30,738: DEBUG/MainProcess] beat: Waking up in 5.00 seconds.
I just want to remove that lines from my log! I don't even understand what that it means.
So I configured the celerybeat
daemon, thinking that this would be the cleaner and suggest solution for a production environment.
Unfortunately when I stat the celerybeat
daemon it creates a log and a pid file but scheduled tasks do not run.
[2014-02-17 19:15:41,919: INFO/MainProcess] beat: Starting...
[2014-02-17 19:15:41,921: INFO/MainProcess] Writing entries...
[2014-02-17 19:15:42,072: DEBUG/MainProcess] Current schedule:
<ModelEntry: celery.backend_cleanup celery.backend_cleanup(*[], **{}) {4}>
<ModelEntry: MyApp.tasks.test_task MyApp.tasks.test_task(*[], **{}) {4}>
[2014-02-17 19:15:42,187: DEBUG/MainProcess] beat: Ticking with max interval->5.00 seconds
[2014-02-17 19:15:42,206: DEBUG/MainProcess] Start from server, version: 0.9, properties: {u'information': u'Licensed under the MPL. See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2011 VMware, Inc.', u'capabilities': {u'exchange_exchange_bindings': True, u'consumer_cancel_notify': True, u'publisher_confirms': True, u'basic.nack': True}, u'platform': u'Erlang/OTP', u'version': u'2.7.1'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
[2014-02-17 19:15:42,207: DEBUG/MainProcess] Open OK!
[2014-02-17 19:15:42,257: INFO/MainProcess] Scheduler: Sending due task MyApp.tasks.test_task (MyApp.tasks.test_task)
And nothing more.
Everything in my understanding works fine (RabbitMQ included, whose log is clean and without errors)
I just need to avoid long useless lines on my log file. Clean and quick solution.
Anyone can help? Thanks!!
I resolved this issue disabling django-debug-toolbar in the production environment. https://github.com/celery/celery/issues/1877
It seems that django-celery and django-debug-toolbar sometimes may mess the logging configuration.