PATCH: $time_custom supports a custom log timestamp

Michał Jaszczyk jasiu85 at
Mon Aug 24 23:20:05 MSD 2009


> The code caches the strftime() expansion so that all loggers using the
> named log format cause strftime() to be called at most once per second.

Could you elaborate a little bit more on that part? If the time is
cached for one second, it makes little sense to use millisecond
precision. Or did I get something wrong? I suppose that in debug mode
I'd like strftime() value to be not cached at all, so that I get
millisecond-accurate times and I can measure request/response times to
backends etc. OTOH in production mode if I'm under heavy load (tons of
reqs/s) I may want to see millisecond-accurate times for some reason.
In that case maybe strftime() can be cached request-wise instead of
second-wise. But, if you log only one line per request, such caching
doesn't bring any improvement. So maybe you could make caching
configurable via some other directive? And does
not-caching-strftime-value cause big performance impact anyway?

These are my thoughts. It's a nice piece of work anyway!


Michał Jaszczyk

More information about the nginx mailing list