I've got an installation with django-nginx-gunicorn-supervisor-postgresql. In the Django admin, I've got a 504 if the loading of the view takes more than around 5 seconds.
For instance, if I filter a change list view with many records and takes more than that time, the 504 appears. The same view with fewer records works, as long as it takes less time.
I've noticed also that some views are still running in the background, even after the 504, cause I can see the modifications they make in the database after they finish.
I've tried to increase all timeouts I've found (nginx, gunicorn), but none of them was configured to 5 seconds. Any guess of what could be misconfigured? Or where could be the timeout that raises the 504?
Thanks
The timeouts I've configured are:
In /etc/nginx/sites-enabled/mysite
proxy_connect_timeout 60;
proxy_read_timeout 90;
proxy_send_timeout 90;
send_timeout 90;
fastcgi_read_timeout 300;
In /etc/nginx/nginx.conf
send_timeout 300;
keepalive_timeout 65;
proxy_connect_timeout 300;
proxy_read_timeout 300;
proxy_send_timeout 300;
In the gunicorn_start file (launched by supervisor)
exec gunicorn -c ${CONF_FILE} ${DJANGO_WSGI_MODULE}:application \
--name ${NAME} \
--user=${USER} --group=${GROUP} \
--log-level=debug \
--timeout=90
In the gunicorn.conf file (previous ${CONF_FILE})
timeout = 90
graceful_timeout = 30
keepalive = 3