From 904358bb003ab581da2f4219f90e55a010bb426c Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 5 Aug 2022 17:13:27 +0200 Subject: [PATCH] allow changing gunicorn settings --- .env.template | 4 ++++ boot.sh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index c76e7c8d..8bf5b484 100644 --- a/.env.template +++ b/.env.template @@ -68,6 +68,10 @@ SHOPPING_MIN_AUTOSYNC_INTERVAL=5 # when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate GUNICORN_MEDIA=0 +# GUNICORN SERVER RELATED SETTINGS (see https://docs.gunicorn.org/en/stable/design.html#how-many-workers for recommended settings) +# GUNICORN_WORKERS=1 +# GUNICORN_THREADS=1 + # S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio) # as long as S3_ACCESS_KEY is not set S3 features are disabled # S3_ACCESS_KEY= diff --git a/boot.sh b/boot.sh index e4fa160e..fc9f44ee 100644 --- a/boot.sh +++ b/boot.sh @@ -2,6 +2,8 @@ source venv/bin/activate TANDOOR_PORT="${TANDOOR_PORT:-8080}" +GUNICORN_WORKERS="${GUNICORN_WORKERS:1}" +GUNICORN_THREADS="${GUNICORN_THREADS:1}" NGINX_CONF_FILE=/opt/recipes/nginx/conf.d/Recipes.conf display_warning() { @@ -63,4 +65,4 @@ echo "Done" chmod -R 755 /opt/recipes/mediafiles -exec gunicorn -b :$TANDOOR_PORT --access-logfile - --error-logfile - --log-level INFO recipes.wsgi +exec gunicorn -b :$TANDOOR_PORT -workers :$GUNICORN_WORKERS --threads :GUNICORN_THREADS --access-logfile - --error-logfile - --log-level INFO recipes.wsgi