110: Connection timed out (Nginx/Gunicorn)

前端 未结 5 609
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 23:50

I\'m running django on gunicorn+nginx. I\'m facing a problem with file uploads. Actually uploads are working fine but gunicorn times out thus causing this in nginx:

5条回答
  •  忘掉有多难
    2020-11-29 00:05

    We had the same problem using Django+nginx+gunicorn. From Gunicorn documentation we have configured the graceful-timeout that made almost no difference.

    After some testings, we found the solution, the parameter to configure is: timeout (And not graceful timeout). It works like a clock..

    So, Do:

    1) open the gunicorn configuration file

    2) set the TIMEOUT to what ever you need - the value is in seconds

    NUM_WORKERS=3
    TIMEOUT=120
    
    exec gunicorn ${DJANGO_WSGI_MODULE}:application \
    --name $NAME \
    --workers $NUM_WORKERS \
    --timeout $TIMEOUT \
    --log-level=debug \
    --bind=127.0.0.1:9000 \
    --pid=$PIDFILE
    

提交回复
热议问题