1
celery -A app worker -Q priority_high -B -l debug --purge -n priority_high_worker

celery -A app worker -Q default -B -l debug --purge -n default_worker

celery -A app beat -l info

As of now we are running the three commands in screens. What is the more production way of running these commands?

Jiahao Cai
  • 1,222
  • 1
  • 11
  • 25
Bharat Bittu
  • 525
  • 1
  • 9
  • 26

1 Answers1

0

The easiest way to create daemons is with . , which also uses django and celery recommends using supervisord to run the workers - you can adjust the configuration to suit your set up:

[program:celery-priority-high]
directory=/www/my_app/
command=/path/to/celery -A app worker -Q priority_high -B -l debug --purge -n priority_high_worker
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=syslog
stderr_logfile=syslog

You can, of course, also run django itself using this method.


If supervisord is too much bloat for your needs, you can also create init scripts for your init system of choice (eg. systemd).

Anonymous
  • 11,740
  • 3
  • 40
  • 50