0

I'm using the following with my Django application:

  1. Django channels
  2. Celery with both regular and periodic tasks
  3. Deployed on Heroku

My Procfile looks like this:

web: daphne artist_notify.asgi:channel_layer --port $PORT --bind 0.0.0.0 -v2
worker: python manage.py migrate --noinput && python manage.py runworker -v2
celerybeat: celery -A artist_notify beat -l info
celeryworker: celery -A artist_notify worker -l info

This combination seems to be expensive, and I'm wondering if I can make it better. I tried combining celerybeat and celeryworker (with &&) into one dyno called celery, like so:

celery: celery -A artist_notify beat -l info && celery -A artist_notify worker -l info

But that doesn't work, although other && combinations do work. I'm wondering if I can maybe combine the workers from worker and celeryworker?

zerohedge
  • 3,185
  • 4
  • 28
  • 63
  • You can use the `-b` argument to start the normal worker with a beat. – Daniel Roseman Jun 25 '18 at 06:51
  • @DanielRoseman Thanks for your help. [celery recommends not doing that](http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#starting-the-scheduler): "You can also embed beat inside the worker by enabling the workers -B option, this is convenient if you’ll never run more than one worker node, but it’s not commonly used and for that reason isn’t recommended for production use". (I wonder *why* they recommend against it though...) – zerohedge Jun 25 '18 at 06:53

0 Answers0