$request_time is 0.000 with gzip/chunked?

Maxim Dounin mdounin at mdounin.ru
Fri Jan 31 02:40:28 UTC 2014


On Fri, Jan 31, 2014 at 10:16:55AM +1300, Robert Coup wrote:


> > 2. Try to run
> > curl --limit-rate 100k
> > to be sure, that request time >> 1 ms.
> >
> Adding --limit-rate does give me a non-zero request time, but it seems to
> take quite a different code-path.

A zero request time indicate that nginx never exhausted socket's 
output buffer while sending a response to a client, and hence was 
able to complete sending within a single event loop iteration.  
Time only refreshed before an event loop iteration, so in this 
case logged $request_time will be zero.

In your case it looks like it happens due to loopback network 
connection is way faster than gzipping.  Limiting network 
bandwidth expectedly resolves this.

Maxim Dounin

More information about the nginx-devel mailing list