in Coding, Lua, nginx

NGINX Timer Resolution

Using ngx.time or is encouraged over using Lua’s built in functions because they use the cached time rather than performing a syscall, but how often is the cache updated?

After a bit of a dig, it turns out there’s no absolute answer, because the cache is actually updated when a kernel event fires:

It can be set manually using nginx’s timer_resolution
but this is not recommended because it either causes too many syscalls if set too low, or necessary time lag if set too high.