Celery Beats Not on Iroka

I have an application that I launched on Heroku, but the Celery extraction process does not start when I start the server.

PROCFILE

web: gunicorn -w 4 connect.wsgi celery: python manage.py celeryd -c 3 --beat 

An employee can be started after launching the Heroku application:

 $ heroku ps === web (Free): gunicorn -w 4 connect.wsgi (1) web.1: starting 2016/07/13 16:17:18 -0400 (~ 9s ago) === celery (Free): python manage.py celeryd -c 3 --beat (1) celery.1: up 2016/07/13 16:17:25 -0400 (~ 2s ago) 

However, in order to start the process of beating Celery, I have to explicitly start it in Heroku with:

 heroku run python manage.py celerybeat 

Beating celery stops locally. Is this a limitation to Heroku or am I doing something wrong?

+5
source share
3 answers

Heroku only allows two free instances of Dyno in one application, if I'm not mistaken.

+4
source

@ Jared Goguen: Hello,

You probably need to increase the number of your employees at Heroku,

Heroku Deployment

If you have already created the Procfile above and connected the appropriate add-ins for the message broker and the result store, all that remains to be done is to click and scale your application:

 git push heroku master heroku ps:scale worker=1 

Of course, at any time you can scale any number of working speakers. Now run the task in the same way as locally:

 heroku run python >>> import tasks >>> tasks.add.delay(1, 2) 

You should see the task running in the application logs:

 heroku logs -t -p worker 

Source: Heroic Guides

+1
source

If you work at a free level for a hero with one dynamo, then you are best off using the honcho python foreman clone - a tool for managing applications based on Procfile. clone https://github.com/nickstenning/honcho , this will allow you to unlock multiple processes for your side effects / workers. You will still be limited by 512 MB RAM and dynamic runtime. So nothing too heavy for dev and poc quick development

install honcho

pip install honcho

Make sure honcho is part of your requirement. txt

pip freeze> requirements.txt

Create ProcfileHoncho to save all Procfile source content

Procfilehoncho

 web: gunicorn myDjangoApp.wsgi --log-file - worker1: celery -A myDjangoApp beat -l info worker2: celery -A myDjangoApp worker -l info 

PROCFILE

 web: honcho start -f ProcfileHoncho 

make sure you upload your broker url through the vars config and point to your free managed broker. I am sure that you can find one free broker with quick google search

 git push heroku master heroku logs -t 

Check the logs for any errors. At this point you should be good to go.

+1
source

All Articles