diff options
Diffstat (limited to 'src/event/ngx_event_timer.h')
-rw-r--r-- | src/event/ngx_event_timer.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/event/ngx_event_timer.h b/src/event/ngx_event_timer.h index 0eae57043..bf5d15515 100644 --- a/src/event/ngx_event_timer.h +++ b/src/event/ngx_event_timer.h @@ -77,7 +77,14 @@ ngx_inline static void ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer) #endif if (ev->timer_set) { - if (key - ev->rbtree_key < 50) { + + /* + * Use the previous timer value if a difference between them is less + * then 100 milliseconds. It allows to minimize the rbtree operations + * for the fast connections. + */ + + if (key - ev->rbtree_key < 100 / NGX_TIMER_RESOLUTION) { ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, "event timer: %d, old: %d, new: %d", ngx_event_ident(ev->data), ev->rbtree_key, key); |