that doesn't actually work:<div><br></div><div>[emerg]: unknown "request_time000" variable<br><br></div><div>any ideas?</div><div><br><div class="gmail_quote">On Fri, Aug 27, 2010 at 2:41 PM, Arthur Blake <span dir="ltr"><<a href="mailto:arthur.blake@gmail.com">arthur.blake@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Is there anyway to get the request time in microseconds resolution in order to emulate Apache's %D log format option?<div>
It looks like the only option at this time is to just fake it with something like "$request_time000" (since 1 millsecond = 1000 microsecond)<div><div></div><div class="h5"><br>
<br><div class="gmail_quote">On Thu, Aug 26, 2010 at 6:59 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<div><br>
On Thu, Aug 26, 2010 at 11:23:47PM +0200, Xavier Martin wrote:<br>
<br>
> Hello,<br>
><br>
> I've been using this settings for a while:<br>
> timer_resolution 100ms;<br>
> log_format combined_time '$remote_addr - $remote_user [$time_local] '<br>
> '"$request" $status $body_bytes_sent '<br>
> '"$http_referer" "$http_user_agent"'<br>
> ' $request_time';<br>
> access_log /var/log/access.log combined_time;<br>
><br>
> Right now i'm needing more precise timestamp in logs<br>
> => finding requests that took less than 50ms to complete.<br>
><br>
> I would like to know what are the drawbacks of using a lower number<br>
> (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't notice.<br>
<br>
But actually I would recommend using the default (i.e. unset).<br>
It's not really different from 10ms on loaded servers and wouldn't<br>
cause extra work on otherwise idle servers.<br>
<font color="#888888"><br>
Maxim Dounin<br>
</font><div><div></div><div><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">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></div></div>
</blockquote></div><br></div>