By getpushpan
I have a django app and it is accessed via digital ocean auto generated ip address. I used to have this issue but it was not that often but today it was happening in every click. basically issue is when navigate to another link it gives me two types of errors. sometimes err_empty_response and sometime connection reset. most of the time the page gets auto reloaded and works fine. but real problem is when i have to submit the form. Basically i followed this tutorial to setup my server so you can assume that i have exactly same settings https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
The issue you’re experiencing with intermittent ERR_EMPTY_RESPONSE and “connection reset” errors in your Django application, especially when navigating to different links or submitting forms, can be caused by several factors. Given that you followed DigitalOcean’s tutorial for setting up Django with PostgreSQL, Nginx, and Gunicorn on Ubuntu 16.04, let’s consider some common causes and solutions:
Gunicorn workers might be timing out. This can happen if your Django views take too long to respond. To address this:
Nginx might be improperly configured or might be facing timeout issues.
/var/log/nginx/error.log) for any specific error messages.proxy_read_timeout and proxy_connect_timeout in your Nginx configuration.Intermittent network issues between your server and the clients can cause these errors.
top, htop, or uptime to monitor server load.There might be errors in your Django application causing it to respond inconsistently.
Connection issues with PostgreSQL could also cause intermittent errors.
DATABASES configuration in settings.py) are correct and stable.If your server is running low on resources (CPU, RAM), it can lead to various issues.
External factors like DDoS attacks or issues with DigitalOcean’s network infrastructure can also cause such issues.
Always make sure to back up your configurations before making significant changes, and if possible, test these changes in a staging environment before applying them to production.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.