From 39223f0f65d642050acb459ccea991a3368e043d Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 16 Dec 2020 12:49:13 +0100 Subject: [PATCH] Docker setup: Allow to configure number of worker processes --- deployment/docker/pretix.bash | 3 ++- doc/admin/installation/docker_smallscale.rst | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/deployment/docker/pretix.bash b/deployment/docker/pretix.bash index e610d9769..24876de9f 100644 --- a/deployment/docker/pretix.bash +++ b/deployment/docker/pretix.bash @@ -3,9 +3,10 @@ cd /pretix/src export DJANGO_SETTINGS_MODULE=production_settings export DATA_DIR=/data/ export HOME=/pretix -export NUM_WORKERS=$((2 * $(nproc --all))) AUTOMIGRATE=${AUTOMIGRATE:-yes} +NUM_WORKERS_DEFAULT=$((2 * $(nproc --all))) +export NUM_WORKERS=${NUM_WORKERS:-$NUM_WORKERS_DEFAULT} if [ ! -d /data/logs ]; then mkdir /data/logs; diff --git a/doc/admin/installation/docker_smallscale.rst b/doc/admin/installation/docker_smallscale.rst index 9a1512fb3..744745892 100644 --- a/doc/admin/installation/docker_smallscale.rst +++ b/doc/admin/installation/docker_smallscale.rst @@ -295,7 +295,9 @@ on one machine after each upgrade manually, otherwise multiple containers might database schema at the same time. To run only the ``pretix-web`` component of pretix as well as a nginx server serving static files, you -can invoke the container with ``docker run … pretix/standalone:stable web`` (instead of ``all``). +can invoke the container with ``docker run … pretix/standalone:stable web`` (instead of ``all``). You +can adjust the number of ``gunicorn`` processes with the ``NUM_WORKERS`` environment variable (defaults to +two times the number of CPUs detected). To run only ``pretix-worker``, you can run ``docker run … pretix/standalone:stable taskworker``. You can also pass arguments to limit the worker to specific queues or to change the number of concurrent task