Upstream response time populated even when upstream connection timed out.

Maxim Dounin mdounin at mdounin.ru
Sat Feb 10 14:42:44 UTC 2024


Hello!

On Fri, Feb 09, 2024 at 12:15:54PM +0000, Sambhav Gupta via nginx-devel wrote:

> I have noticed that upstream response time is populated to a 
> non-zero and non-negative value in Nginx even when upstream 
> connection times out.
> 
> This is not true with other values like upstream connect time 
> and upstream header time.
> 
> Is this intentional ?

Yes.  The $upstream_response_time variable shows total time spent 
when working with the upstream, with all the activities included.  
It is always set as long as nginx was working with an upstream, 
even if there was an error or a timeout.

In contrast, $upstream_connect_time and $upstream_header_time are 
only set when the connection was established or the header was 
successfully received, respectively.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx-devel mailing list