From 31ac86e39089f6e0d89d249e884cecf04e596916 Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 27 Jun 2018 12:14:06 -0300 Subject: [PATCH] Configura um timeout maior para gunicorn's workers --- gunicorn_start.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 4f58022ce..2021aa83e 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -16,8 +16,9 @@ DJANGODIR=/var/interlegis/sapl/ # Django project directory (* SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) -NUM_WORKERS=4 # how many worker processes should Gunicorn spawn (*) +NUM_WORKERS=9 # how many worker processes should Gunicorn spawn (*) # NUM_WORKERS = 2 * CPUS + 1 +TIMEOUT=60 MAX_REQUESTS=100 # number of requests before restarting worker DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) @@ -41,6 +42,7 @@ test -d $RUNDIR || mkdir -p $RUNDIR # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon) exec gunicorn ${DJANGO_WSGI_MODULE}:application \ --name $NAME \ + --timeout $TIMEOUT \ --workers $NUM_WORKERS \ --max-requests $MAX_REQUESTS \ --user $USER \