On 18/04/2021 16.51, Sunday Iyanu Ajayi wrote:
> Hi Team
> 
> Please I am having serious issue with my nginx server.
> 
> At midnight when the traffic on the server is at it peak, my server
> spikes and I get 502 error and from the nginx error log, I get :
> 
> upstream prematurely closed connection while reading response header
> from upstream
> 
> upstream timed out (110: Connection timed out) while reading response
> header from upstream
>

You most likely don't have a problem with your nginx server. Your nginx
server has a problem reading a response from your Django application
which is the reason it times out.

It can be a bit tricky to figure out the cause of the heavy load, but I
would start by looking in your Django server logs and see if there might
be something obvious there.

If you have a chance to get a look at your server while it's under heavy
load and starts giving timeouts, something like htop and similar tools
might be able to give you a hint at the bottleneck. If you're database
server is maxing out all your CPU cores, then that could give a good
hint on where to look.

Hope that helps a bit.

Kind regards,

Kasper Laudrup

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8bdddaa7-b019-da24-6537-516f56523fbb%40stacktrace.dk.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to