Skip to content

Instantly share code, notes, and snippets.

@holms
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holms/45a8e4164c588e055281 to your computer and use it in GitHub Desktop.
Save holms/45a8e4164c588e055281 to your computer and use it in GitHub Desktop.
; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
environment =
CELERYD_OPTS="-Q:notifications_w notifications -Q:statistics_w statistics -Q:reports_w reports --concurrency=8",
CELERYD_NODES="notifications_w statistics_w reports_w",
DATABASE_URL="pgsql://xxx:xxx@db.xxx.com/xxx", SECRET_KEY="_uy0(ey)#9x1i)xxxx!dp8a3l+z!#2)#@1bzep&ne7r9+", DJANGO_SETTINGS="xxx.settings.prod", RABBITMQ_USER="api", RABBITMQ_PASSWORD="xxx"
command=/var/www/shrinktheapp/bin/celery worker -A shrinktheapp --loglevel=INFO
directory=/var/www/shrinktheapp/project
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/worker.log
stderr_logfile=/var/log/celery/worker.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998
; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
environment =
CELERYD_OPTS="-Q:notifications_w notifications -Q:statistics_w statistics -Q:reports_w reports --concurrency=8",
CELERYD_NODES="notifications_w statistics_w reports_w",
DATABASE_URL="pgsql://xxx:xxx@db.xxx.com/xxx",
SECRET_KEY="_uy0(ey)#9x1i)xxxx!dp8a3l+z!#2)#@1bzep&ne7r9+",
DJANGO_SETTINGS="xxx.settings.prod",
RABBITMQ_USER="api",
RABBITMQ_PASSWORD="xxx"
command=/var/www/shrinktheapp/bin/celery worker -A shrinktheapp --loglevel=INFO
directory=/var/www/shrinktheapp/project
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/worker.log
stderr_logfile=/var/log/celery/worker.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998
Romans-MacBook-Air:templates holms$ cat supervisord.conf.j2
; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
environment =
CELERYD_OPTS="{{ celery_opts }}",
CELERYD_NODES="{{ celery_nodes }}",
{% for envvar in celery_env_vars %}
{{ envvar['name'] }}="{{ envvar['value'] }}"{% if not loop.last %},{% endif %}
{% endfor %}
command={{ celery_bin }} worker -A {{ celery_app_module }} --loglevel=INFO
directory={{ celery_app_dir }}
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/worker.log
stderr_logfile=/var/log/celery/worker.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment