110: Connection timed out (Nginx/Gunicorn)

前端 未结 5 607
隐瞒了意图╮
隐瞒了意图╮ 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:08

    This is not an nginx timeout, but probably a Gunicorn timeout. Gunicorn defaults to a 30 second timeout.

    In general, you should fix this by not having an endpoint that takes longer than 30 seconds to return, but if it is a seldom used endpoint, you can also just increase the gunicorn timeout.

    If you do this, you should probably also increase the number of gunicorn worker processes as well.

    To increase the timeout and workers for gunicorn, you can add the following command-line options on start:

    gunicorn --timeout 120 --workers 
    

提交回复
热议问题