Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Increase gunicorn workers and allow more config #6497

Merged
merged 1 commit into from Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -57,3 +57,4 @@ src
generated/

docker-compose.override.yml
celerybeat-schedule.*
7 changes: 5 additions & 2 deletions scripts/container_start.sh
Expand Up @@ -13,12 +13,15 @@ then
echo "[LOG] Running migrations"
python manage.py db upgrade
export PORT=${PORT:-8080}
export GUNICORN_WORKERS=${GUNICORN_WORKERS:-4}
export GUNICORN_LOG_LEVEL=${GUNICORN_LOG_LEVEL:-info}
echo "[LOG] Starting gunicorn on port ${PORT}"
gunicorn -b 0.0.0.0:${PORT} app:app -w 1 --enable-stdio-inheritance --log-level "warning" --proxy-protocol --preload
gunicorn -b 0.0.0.0:${PORT} app:app -w $GUNICORN_WORKERS --enable-stdio-inheritance --log-level $UNICORN_LOG_LEVEL --proxy-protocol --preload
fi
if [ "$DEPLOYMENT" == "celery" ]
then
echo "[LOG] Starting celery worker"
export INTEGRATE_SOCKETIO=false
celery worker -A app.celery --loglevel=warning
export CELERY_LOG_LEVEL=${CELERY_LOG_LEVEL:-info}
celery worker -B -A app.celery --loglevel=$CELERY_LOG_LEVEL
fi