Skip to content

Commit

Permalink
feat: Increase gunicorn workers and allow more config (#6497)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Oct 3, 2019
1 parent b7ba05c commit d3b9182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ src
generated/

docker-compose.override.yml
celerybeat-schedule.*
7 changes: 5 additions & 2 deletions scripts/container_start.sh
Original file line number Diff line number Diff line change
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

0 comments on commit d3b9182

Please sign in to comment.