April 09, 2019 07:45AM
I use nginx(1.15.3) as a reverse-proxy, and encounter a problem that $upstream_response_time is larger than $request_time" in log files.

According to nginx documentation,

$upstream_response_time
keeps time spent on receiving the response from the upstream server; the time is kept in seconds with millisecond resolution. Times of several responses are separated by commas and colons like addresses in the $upstream_addr variable.

$request_time
request processing time in seconds with a milliseconds resolution; time elapsed between the first bytes were read from the client and the log write after the last bytes were sent to the client

So, $request_time should include $upstream_response_time.

I had analyzed the total count of log records of which response code is 200:

$upstream_response_time < $request_time : 35812
$upstream_response_time = $request_time : 157043
$upstream_response_time > $request_time : 32783 {
$upstream_response_time - $request_time = 0.001 : 32558
$upstream_response_time - $request_time = 0.002 : 225
}

What's the reason?

Thanks.
Subject Author Posted

nginx log : $upstream_response_time is larger than $request_time

mchtech April 09, 2019 07:45AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 250
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready