Hello How do i configure celery to start automatically when django starts?

asked 17 Feb '11, 14:17

aziz's gravatar image

accept rate: 0%

You Django application is started by a cron job. The easiest way to start djcelery is to add a cron job that starts it.

We have information on using cron here:


permanent link

answered 17 Feb '11, 15:26

aaronh's gravatar image

aaronh ♦♦
accept rate: 34%

but wont that cause multiple celery instances to start thus using more memory?

(18 Feb '11, 03:53) aziz aziz's gravatar image

There is documentation here on how to create an init script:


Could you help me map the approp folders to use in webfaction?

(18 Feb '11, 04:01) aziz aziz's gravatar image

You can just use cron and a script to check if celeryd is already running:


if ps -u yourusername -o command | grep -v grep | egrep 'yourapp/myproject/manage.py celeryd' > /dev/null
   echo "$SERVICE running, nothing done"
   echo "$SERVICE not running, starting..."
   /usr/local/bin/pythonX.Y /home/yourusername/webapps/yourapp/myproject/manage.py celeryd -c 2 &

Save it as celery_daemon.sh and then create an entry in the crontab with something like:

0 1 * * * ~/webapps/yourapp/celery_daemon.sh 2>> ~/webapps/yourapp/sittic_celery.log
permanent link

answered 23 Dec '11, 12:01

Gooler's gravatar image

accept rate: 0%

note it's important to name your bash script something that won't get picked up in the egrep

You were fine here egrep 'yourapp/myproject/manage.py celeryd' but in my case I had just egrep 'supervisord' and had called my script start_supervisord.sh ...it always thought supervisord was still running!

(17 Mar '13, 15:54) anentropic anentropic's gravatar image

thanks for the handy tip anyway!

(17 Mar '13, 15:54) anentropic anentropic's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 17 Feb '11, 14:17

question was seen: 4,224 times

last updated: 17 Mar '13, 15:54

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited