Skip to content
Snippets Groups Projects
Commit a862d36e authored by Benjamin Ledel's avatar Benjamin Ledel
Browse files

*make worker adjustable #164

parent edcfd845
No related branches found
No related tags found
1 merge request!1#155: fixed data disclosure tests for environments where no mongodb is...
Pipeline #1656304 passed
......@@ -372,3 +372,18 @@ Content `traefik.toml`
statusCodes = ["200", "300-302"]
```
## Adjust deployment
### Number of gunicorn workers
The number of Gunicorn workers can be adjusted using the WORKERS environment variable.
By default, the application starts with 4 workers. You can override this value during deployment:
```docker-compose.yml
services:
web:
image: registry.git.rwth-aachen.de/polaris/rights-engine/rights-engine:${POLARIS_VERSION}
ports:
- "80:80"
environment:
- WORKERS=10
```
\ No newline at end of file
#!/bin/sh
# Set default number of workers to 4 if not provided via environment
: "${WORKERS:=4}"
echo "Running database migrations and role setup..."
python manage.py check_and_apply_migrations
echo "Starting Gunicorn server..."
exec env "$@" gunicorn --bind :80 --workers 3 --timeout 240 --access-logfile - --error-logfile - backend.wsgi
echo "Starting Gunicorn server with $WORKERS workers..."
exec env "$@" gunicorn \
--bind :80 \
--workers "$WORKERS" \
--timeout 300 \
--graceful-timeout 300 \
--max-requests 1000 \
--max-requests-jitter 50 \
--access-logfile - \
--error-logfile - \
backend.wsgi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment