Skip to content

Commit

Permalink
Set celery max_memory_per_child to 2GiB
Browse files Browse the repository at this point in the history
- Configurable via WORKER_MAX_MEMORY_PER_CHILD environment variable
- Closes #657
  • Loading branch information
Uxio0 committed Jan 27, 2022
1 parent 7734cb8 commit 3ade858
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docker/web/celery/worker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ python manage.py migrate --noinput
echo "==> $(date +%H:%M:%S) ==> Setting up service... "
python manage.py setup_service

echo "==> $(date +%H:%M:%S) ==> Running Celery worker <=="
exec celery -C -A config.celery_app worker --loglevel $log_level --pool=gevent --concurrency=${CELERYD_CONCURRENCY:-500}
MAX_MEMORY_PER_CHILD="${WORKER_MAX_MEMORY_PER_CHILD:-2097152}"
echo "==> $(date +%H:%M:%S) ==> Running Celery worker with a max_memory_per_child of ${MAX_MEMORY_PER_CHILD} <=="
exec celery -C -A config.celery_app worker --loglevel $log_level --pool=gevent \
--concurrency=${CELERYD_CONCURRENCY:-500} --max-memory-per-child=${MAX_MEMORY_PER_CHILD}

0 comments on commit 3ade858

Please sign in to comment.