Created
November 23, 2016 10:11
-
-
Save foxmask/5023d93e14c61e582d509a354e086520 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source $(dirname $0)/init.cfg | |
echo "Starting Gunicorn for $NAME" | |
exec ../bin/gunicorn ${DJANGO_WSGI_MODULE}:application \ | |
--name $NAME \ | |
--workers $NUM_WORKERS \ | |
--user=$USER --group=$GROUP \ | |
--log-level=$LOG_LEVEL \ | |
--bind=$IP:$PORT \ | |
--access-logfile $ACCESSFILE --error-logfile $ERRORFILE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME="th" # Name of the application | |
DJANGODIR=/home/trigger-happy/th/ # Django project directory | |
USER=foxmask # the user to run as | |
GROUP=foxmask # the group to run as | |
NUM_WORKERS=1 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=th.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=th.wsgi # WSGI module name | |
IP=127.0.0.1 | |
PORT=8080 | |
#LOG | |
LOGDIR=/home/trigger-happy/logs/ | |
#LOG_LEVEL=DEBUG | |
LOG_LEVEL=INFO | |
ERRORFILE="$LOGDIR$NAME-error.log" | |
ACCESSFILE="$LOGDIR$NAME-access.log" | |
HTTPS=on | |
# Activate the virtual environment | |
cd $DJANGODIR | |
source ../bin/activate | |
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE | |
export PYTHONPATH=$DJANGODIR:$PYTHONPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
quand on rajoute le timeout et le worker class à gunicorn
mais que ca timeout toujours autant et que le worker n'est pas le bon
"Using worker: sync"
comme ca c'est mieux, en evitant de config ca tard la nuit :)