<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body style="background-color: rgb(255, 255, 255); color: rgb(0,
0, 0);" text="#000000" bgcolor="#FFFFFF">> - a cache hit means
that the resource should also be in the linux page cache - so no
physical disk read needed.<br>
<br>
That's a very wrong assumption to make, and only makes sense in very
small scale setups - and multiple terabytes of memory isn't exactly
cheap, that's why we have SSD storage to handle such things, and it
would still be a "HIT" even if it's not within the memory.<br>
<br>
<br>
<br>
<span>Peter Booth wrote:</span><br>
<blockquote cite="mid:106169aa-679b-4c41-945c-26241aae0c70@me.com"
type="cite"><div>This might not be a bug at all. Remember that when
nginx logs
request </div>
<div>time it's doing so with millisecond precision. This is very, very
coarse-grained when you consider what</div>
<div>modern hardware is capable of. The Tech Empower benchmarks shwo
that an (openresty) nginx on</div>
<div> a quad-socket host can server more than 800,000 dynamic lua
requests per second. We should expect </div>
<div>that static resources served from ngixn cache to be faster than
this.</div>
<div><br data-mce-bogus="1"></div>
<div>Remember:</div>
<div> - a cache hit means that the resource should also be in the
linux page cache - so no physical disk read needed.</div>
<div>- writing a small png file from memory to the network (on a 10G
ethernet ) could take a few microsec. Depending on NIC IRQ consolidation
settings this might be as much as 60/70micros.</div>
<div>- reading the time (gettimeofday()) will itself take about 30
nanoseconds.</div>
<div><br data-mce-bogus="1"></div>
<div>These are al intervals that are too small to be visible to the
1ms granularity of the request_time logging.</div>
<div><br data-mce-bogus="1"></div>
<div>My experience has been that very busy webservers running on even
five year old hardware</div>
<div>will consistently log 0ms request time for cache hits. If I saw
anything different I'd be wondering</div>
<div>what was wrong with the environment.</div>
<div><br data-mce-bogus="1"></div>
<div>Peter</div>
<div><br>On Jun 22, 2017, at 05:53 AM, jindov
<a class="moz-txt-link-rfc2396E"
href="mailto:nginx-forum@forum.nginx.org"><nginx-forum@forum.nginx.org></a>
wrote:<br><br></div>
<div><blockquote type="cite"><div class="msg-quote"><div
class="_stretch"><span class="body-text-content">Hi guys,<br><br>I've
configured for nginx to cache static like jpeg|png. The problem is if<br>request
with MISS status, it will show a non-zero value request_time, but if<br>a
HIT request, the request_time value is 0.000.<br>This is an nginx bug
and is there anyway to resolve it.<br><br>My log format<br><br>```<br>log_format
cache '$remote_addr - [$time_local] $upstream_cache_status<br>$upstream_addr
'<br> '"$request" $status $body_bytes_sent $request_time<br>["$upstream_response_time"]
"$http_referer" '<br> '"$http_user_agent" "$host" "$server_port"<br>"$connection"';<br>```<br><br>I
read a topic about this but this is not informational. I've try to set<br>timer_resolution
to 0ms but nothing was changed<br><br>Thanks<br><br>Posted at Nginx
Forum: <a moz-do-not-send="true"
href="https://forum.nginx.org/read.php?2,275053,275053#msg-275053"
data-mce-href="https://forum.nginx.org/read.php?2,275053,275053#msg-275053">https://forum.nginx.org/read.php?2,275053,275053#msg-275053</a><br><br>_______________________________________________<br>nginx
mailing list<br><a moz-do-not-send="true" href="mailto:nginx@nginx.org"
data-mce-href="mailto:nginx@nginx.org">nginx@nginx.org</a><br><a
moz-do-not-send="true"
href="http://mailman.nginx.org/mailman/listinfo/nginx"
data-mce-href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></span></div></div></blockquote></div>
<pre wrap="">_______________________________________________
nginx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></pre></blockquote>
<br>
<br>
</body></html>