Nginx upstream delays
mdounin at mdounin.ru
Tue Mar 10 14:39:01 UTC 2015
On Mon, Mar 09, 2015 at 04:28:22PM +0100, Wiebe Cazemier wrote:
> I have a question about sporadic long upstream response times
> I'm seeing on (two of) our Nginx servers. It's kind of hard to
> show and quantify, but I'll do my best.
> One is a Django Gunicorn server. We included the upstream
> response time in the Nginx access log and wrote a script to
> analyze them. What we see, is that on the login page of a
> website (a page that does almost nothing) 95%-99% of 'GET
> /customer/login/' requests are processed within about 50 ms. The
> other few percent can take several seconds. Sometimes even 5s.
> Our Munin graphs show no correlation in disk latency, cpu time,
> memory use, etc.
> I also added an access log to Gunicorn, so that I can see how
> long Gunicorn takes to process requests that Nginx thinks take
> long. Gunicorn has 8 workers. It can be seen that there is
> actually no delay in Gunicorn. For instance, Nginx sees this
> (the long upstream response time is marked red, 3.042s):
The 3s time suggests there is a packetloss somewhere.
More information about the nginx