1

Sending a 'large' POST request to gUnicorn will cause it to freeze and eventually timeout. This is both on my production server and development server (both running Ubuntu 20.04). It just freezes before returning

[CRITICAL] WORKER TIMEOUT (pid:10000)

Django's default dev server works without issues.

My WSGI file:

  import os    
  from django.core.wsgi import get_wsgi_application
  os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'djangoProject.settings')
  application = get_wsgi_application()
Matthew Hegarty
  • 3,791
  • 2
  • 27
  • 42

1 Answers1

0

Try this (assuming that 180 sec timeout is enough):

  1. Add --timeout TIMEINSECONDS \ to your guncicorn config file.
  2. Try these nginx config file options.

Nginx config

server {
    keepalive_timeout 180s;
    send_timeout 180s;
    proxy_connect_timeout 180s;
    proxy_send_timeout 180s;
    proxy_read_timeout 180s;
    
    ...rest of the config
}
mon io
  • 732
  • 5
  • 8