Changes between Initial Version and Version 1 of Ticket #1965, comment 2


Ignore:
Timestamp:
08/03/23 19:37:58 (9 months ago)
Author:
Maxim Dounin

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1965, comment 2

    initial v1  
    1 That's because `$upstream_response_time` uses monotonic time as `clock_gettime(CLOCK_MONOTONIC_COARSE)` ono Linux (see ticket #189), and it might be slightly wrong due to low accuracy (with typical `CONFIG_HZ=250` it is only updated once per 4ms). In contrast, `$request_time` currently uses `gettimeofday()` and might be wrong if wall clock time changes.
     1That's because `$upstream_response_time` uses monotonic time as `clock_gettime(CLOCK_MONOTONIC_COARSE)` on Linux (see ticket #189), and it might be slightly wrong due to low accuracy (with typical `CONFIG_HZ=250` it is only updated once per 4ms). In contrast, `$request_time` currently uses `gettimeofday()` and might be wrong if wall clock time changes.
    22
    33In this particular case the difference 0.012 vs. 0.011 is clearly due to `CLOCK_MONOTONIC_COARSE` being used with `CONFIG_HZ=250`. As mentioned in #1678, a possible solution might be to avoid using `CLOCK_MONOTONIC_COARSE` and switch to `CLOCK_MONOTONIC` instead. This way `$upstream_response_time` will be identical to `$request_time` as long as there are no wall clock time changes.