Skip to content

Commit

Permalink
Merge pull request #4447 from kobotoolbox/celery-autoscale-clean-up
Browse files Browse the repository at this point in the history
Clean up Celery autoscale settings
  • Loading branch information
noliveleger committed May 24, 2023
2 parents 47cd19b + 22b3b73 commit e3357a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 2 additions & 3 deletions docker/run_celery.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
set -e
source /etc/profile

# Run the main Celery worker (will not process low priority jobs).
# Start 2 processes by default; this will be overridden later, in Python code,
# according to the user's preference saved by django-constance
# Run the main Celery worker (will NOT process low-priority jobs)

cd "${KPI_SRC_DIR}"

AUTOSCALE_MIN="${CELERY_AUTOSCALE_MIN:-2}"
Expand Down
10 changes: 6 additions & 4 deletions docker/run_celery_low_priority.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
set -e
source /etc/profile

# Run the main Celery worker (will process only low priority jobs).
# Start 2 processes by default; this will be overridden later, in Python code,
# according to the user's preference saved by django-constance
# Run the Celery worker for low-priority jobs ONLY

cd "${KPI_SRC_DIR}"

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

exec celery -A kobo worker --loglevel=info \
--hostname=kpi_main_worker@%h \
--logfile=${KPI_LOGS_DIR}/celery_low_priority.log \
Expand All @@ -15,4 +17,4 @@ exec celery -A kobo worker --loglevel=info \
--exclude-queues=kpi_queue \
--uid=${UWSGI_USER} \
--gid=${UWSGI_GROUP} \
--autoscale 2,2
--autoscale ${AUTOSCALE_MIN},${AUTOSCALE_MAX}

0 comments on commit e3357a9

Please sign in to comment.