Skip to content

Commit

Permalink
Merge pull request #879 from kobotoolbox/celery-autoscale
Browse files Browse the repository at this point in the history
Autoscale Celery between 2 and 6 workers and allow configuration via environment variables
  • Loading branch information
noliveleger authored May 24, 2023
2 parents d2d9dec + 513a766 commit 7bae386
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 7bae386

Please sign in to comment.