Skip to content

Commit

Permalink
Autoscale Celery between 2 and 6 workers and allow…
Browse files Browse the repository at this point in the history
configuration via environment variables (just like kpi)
  • Loading branch information
jnm committed May 24, 2023
1 parent d2d9dec commit 513a766
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docker/run_celery.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ set -e
source /etc/profile

# Run the main Celery worker

cd "${KOBOCAT_SRC_DIR}"

AUTOSCALE_MIN="${CELERY_AUTOSCALE_MIN:-2}"
AUTOSCALE_MAX="${CELERY_AUTOSCALE_MAX:-6}"

exec celery -A onadata worker -Ofair --loglevel=info \
--hostname=kobocat_main_worker@%h \
--logfile=${KOBOCAT_LOGS_DIR}/celery.log \
--pidfile=${CELERY_PID_DIR}/celery.pid \
--uid=${UWSGI_USER} \
--gid=${UWSGI_GROUP}
--gid=${UWSGI_GROUP} \
--autoscale ${AUTOSCALE_MIN},${AUTOSCALE_MAX}

0 comments on commit 513a766

Please sign in to comment.