nginx-0.0.3-2004-04-02-09:14:40 import
diff --git a/src/event/ngx_event_timer.h b/src/event/ngx_event_timer.h
index 0eae570..bf5d155 100644
--- a/src/event/ngx_event_timer.h
+++ b/src/event/ngx_event_timer.h
@@ -77,7 +77,14 @@
#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);