aboutsummaryrefslogtreecommitdiff
path: root/src/event/ngx_event_timer.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-04-02 05:14:40 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-04-02 05:14:40 +0000
commitdebb39eaedf46e63d22f4604da01cf26a1e8a930 (patch)
tree20890aefc18462a802e6f71951a3ae470b93e4d2 /src/event/ngx_event_timer.h
parentdbb27765706e2d2f35b0af57c317b58d2d9d6ec9 (diff)
downloadnginx-debb39eaedf46e63d22f4604da01cf26a1e8a930.tar.gz
nginx-debb39eaedf46e63d22f4604da01cf26a1e8a930.zip
nginx-0.0.3-2004-04-02-09:14:40 import
Diffstat (limited to 'src/event/ngx_event_timer.h')
-rw-r--r--src/event/ngx_event_timer.h9
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);