Mercurial > hg > nginx
comparison src/core/ngx_times.c @ 7939:9e7de0547f09
Removed CLOCK_MONOTONIC_COARSE support.
While clock_gettime(CLOCK_MONOTONIC_COARSE) is faster than
clock_gettime(CLOCK_MONOTONIC), the latter is fast enough on Linux for
practical usage, and the difference is negligible compared to other costs
at each event loop iteration. On the other hand, CLOCK_MONOTONIC_COARSE
causes various issues with typical CONFIG_HZ=250, notably very inaccurate
limit_rate handling in some edge cases (ticket #1678) and negative difference
between $request_time and $upstream_response_time (ticket #1965).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 21 Oct 2021 18:38:38 +0300 |
parents | 81fae70d6cb8 |
children |
comparison
equal
deleted
inserted
replaced
7938:dc955d274130 | 7939:9e7de0547f09 |
---|---|
198 #if (NGX_HAVE_CLOCK_MONOTONIC) | 198 #if (NGX_HAVE_CLOCK_MONOTONIC) |
199 struct timespec ts; | 199 struct timespec ts; |
200 | 200 |
201 #if defined(CLOCK_MONOTONIC_FAST) | 201 #if defined(CLOCK_MONOTONIC_FAST) |
202 clock_gettime(CLOCK_MONOTONIC_FAST, &ts); | 202 clock_gettime(CLOCK_MONOTONIC_FAST, &ts); |
203 | |
204 #elif defined(CLOCK_MONOTONIC_COARSE) | |
205 clock_gettime(CLOCK_MONOTONIC_COARSE, &ts); | |
206 | |
207 #else | 203 #else |
208 clock_gettime(CLOCK_MONOTONIC, &ts); | 204 clock_gettime(CLOCK_MONOTONIC, &ts); |
209 #endif | 205 #endif |
210 | 206 |
211 sec = ts.tv_sec; | 207 sec = ts.tv_sec; |