Skip to content

Commit

Permalink
Configurable workers and threads
Browse files Browse the repository at this point in the history
  • Loading branch information
guilbaults committed Jul 17, 2024
1 parent c017985 commit 4dfce03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions podman/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ if [ -z "$VERSION" ]; then
VERSION=latest
fi

if [ -z "$WORKERS" ]; then
echo "WORKERS is not set in the config file, using 4"
WORKERS=4
fi

if [ -z "$THREADS" ]; then
echo "THREADS is not set in the config file, using 4"
THREADS=4
fi

podman pod stop TT-$TT_ENV
podman pod rm -f TT-$TT_ENV
podman volume rm -f TT-$TT_ENV-static
Expand All @@ -28,6 +38,8 @@ podman pod create -p $PORT:80 --name TT-$TT_ENV
podman volume create TT-$TT_ENV-static

podman run --detach --pod TT-$TT_ENV --name=TT-$TT_ENV-django \
--env WORKERS=${WORKERS} \
--env THREADS=${THREADS} \
-v $TT_ENV_PATH/99-local.py:/secrets/settings/99-local.py:Z \
-v $TT_ENV_PATH/private.key:/opt/userportal/private.key:Z \
-v $TT_ENV_PATH/public.cert:/opt/userportal/public.cert:Z \
Expand Down
2 changes: 1 addition & 1 deletion run-django-production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set -o nounset
cp /secrets/settings/99-local.py /opt/userportal/userportal/settings/99-local.py
mkdir -p /var/www/api/static
cp -r /opt/userportal/collected-static/* /var/www/api/static/
/opt/userportal-env/bin/gunicorn --bind :8000 --workers 1 --timeout 90 userportal.wsgi
/opt/userportal-env/bin/gunicorn --bind :8000 --workers $WORKERS --threads $THREADS --timeout 90 userportal.wsgi

0 comments on commit 4dfce03

Please sign in to comment.