From 513a766d9e6fdb55358b38297dcf696bca63b440 Mon Sep 17 00:00:00 2001 From: "John N. Milner" Date: Wed, 24 May 2023 10:57:46 -0400 Subject: [PATCH] =?UTF-8?q?Autoscale=20Celery=20between=202=20and=206=20wo?= =?UTF-8?q?rkers=20and=20allow=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit configuration via environment variables (just like kpi) --- docker/run_celery.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker/run_celery.bash b/docker/run_celery.bash index f9c57ea9f..255a3a3f0 100755 --- a/docker/run_celery.bash +++ b/docker/run_celery.bash @@ -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}