Is there anyway to get the request time in microseconds resolution in order to emulate Apache&#39;s %D log format option?<div>It looks like the only option at this time is to just fake it with something like &quot;$request_time000&quot; (since 1 millsecond = 1000 microsecond)<br>
<br><div class="gmail_quote">On Thu, Aug 26, 2010 at 6:59 PM, Maxim Dounin <span dir="ltr">&lt;<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello!<br>
<div class="im"><br>
On Thu, Aug 26, 2010 at 11:23:47PM +0200, Xavier Martin wrote:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;ve been using this settings for a while:<br>
&gt; timer_resolution 100ms;<br>
&gt; log_format combined_time &#39;$remote_addr - $remote_user [$time_local]  &#39;<br>
&gt;                    &#39;&quot;$request&quot; $status $body_bytes_sent &#39;<br>
&gt;                    &#39;&quot;$http_referer&quot; &quot;$http_user_agent&quot;&#39;<br>
&gt;                    &#39; $request_time&#39;;<br>
&gt; access_log /var/log/access.log combined_time;<br>
&gt;<br>
&gt; Right now i&#39;m needing more precise timestamp in logs<br>
&gt; =&gt; finding requests that took less than 50ms to complete.<br>
&gt;<br>
&gt; I would like to know what are the drawbacks of using a lower number<br>
&gt; (i.e 10ms, 0ms or not setting at all timer_resolution) and overhead that would cause (if any).<br>
<br>
</div>With timer_resolution unset (set to 0, default) nginx will call<br>
gettimeofday() on every event loop iteration.  With<br>
timer_resolution set nginx will schedule<br>
gettimeofday() calls at specified interval.<br>
<br>
Obviously changing it from 100ms to 10ms would cause 10 times<br>
more gettimeofday() calls.  But most likely you won&#39;t notice.<br>
<br>
But actually I would recommend using the default (i.e. unset).<br>
It&#39;s not really different from 10ms on loaded servers and wouldn&#39;t<br>
cause extra work on otherwise idle servers.<br>
<font color="#888888"><br>
Maxim Dounin<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>