<div dir="ltr">Hi Maxim,<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 3:40 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br>
</div>A zero request time indicate that nginx never exhausted socket's<br>
output buffer while sending a response to a client, and hence was<br>
able to complete sending within a single event loop iteration.<br>
Time only refreshed before an event loop iteration, so in this<br>
case logged $request_time will be zero.<br></blockquote><div><br></div><div>Makes sense - so you're suggesting I wouldn't see it on a non-loopback network connection where socket buffer is < file size? I was seeing it on a non-loopback connection originally, but will do some more tests to verify. I guess I also wouldn't see it if/when upstream/proxy buffers are exhausted? </div>
<div><br></div><div>I guess I would have expected (not being an nginx guru!) an event loop call to happen for each chain/block being passed through the filters and out to the socket rather than only when the socket rejected it.</div>
<div><br></div><div>Regardless, if $request_time is defined as "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" - and the last bytes couldn't possibly be sent in 0.000ms (since the gzipping takes ~10s), doesn't that indicate a bug?</div>
<div><br></div><div>Background: This isn't an entirely theoretical exercise... we're sending gzipped XML documents to clients with massively varying response sizes (3KB-300MB) and I was looking at writing a module to save the time taken until the first body chunk is sent to the client, so we could track the server response times. And stumbled across this issue.</div>
<div><br></div><div>Thanks, </div><div><br></div><div>Rob :)</div></div></div></div>