Request Time in Nginx Log as always 0.000 for HIT Request

Maxim Dounin mdounin at
Sun Aug 2 19:06:33 UTC 2020


On Sat, Aug 01, 2020 at 04:31:14PM -0400, anish10dec wrote:

> We are observing a behavior where request time and upstream response time is
> logged as same value when request is MISS in log file.
> And when there is HIT for the request , request time is logged as 0.000 for
> all the requests.

nginx updates internal time only once per event loop iteration, so 
it is relatively easy to see $request_time logged as 0 (or 
identical to $upstream_response_time as long as there was an 
request to upstream).  This implies:

- the request can be read immediately without waiting for 
  additional data from client;

- the response is small enough to fit into the socket buffer.

Maxim Dounin

More information about the nginx mailing list