From 482658b1ccbc98fc00941b62eefd341bda800a85 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 17 Oct 2007 17:40:35 +0000 Subject: [PATCH] Faster timeouts, based on extracts of our logs. git-svn-id: file:///svn/unbound/trunk@689 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 2 ++ iterator/iterator.h | 2 +- util/rtt.c | 5 +++-- util/rtt.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index ca537dbbf..7fbfded6b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -15,6 +15,8 @@ where no scripted answer was available. - mark insecure RRs as insecure. - fixup removal of nonsecure items from the additional. + - reduced timeout values to more realistic, 376 msec (262 msec has + 90% of roundtrip times, 512 msec has 99% of roundtrip times.) 16 October 2007: Wouter - no malloc in log_hex. diff --git a/iterator/iterator.h b/iterator/iterator.h index b77870c48..817c00654 100644 --- a/iterator/iterator.h +++ b/iterator/iterator.h @@ -58,7 +58,7 @@ struct iter_prep_list; /** how nice is a server without further information, in msec * Equals rtt initial timeout value. */ -#define UNKNOWN_SERVER_NICENESS 3000 +#define UNKNOWN_SERVER_NICENESS 376 /** maximum timeout before a host is deemed unsuitable, in msec. * After host_ttl this will be timed out and the host will be tried again. * Equals RTT_MAX_TIMEOUT diff --git a/util/rtt.c b/util/rtt.c index bc31e4c91..eefdf7062 100644 --- a/util/rtt.c +++ b/util/rtt.c @@ -60,9 +60,10 @@ void rtt_init(struct rtt_info* rtt) { rtt->srtt = 0; - rtt->rttvar = 750; + rtt->rttvar = 94; rtt->rto = calc_rto(rtt); - /* first RTO is 0 + 4*0.75 = 3 seconds */ + /* default value from the book is 0 + 4*0.75 = 3 seconds */ + /* first RTO is 0 + 4*0.094 = 0.376 seconds */ } int diff --git a/util/rtt.h b/util/rtt.h index 053f5d92a..260945f4f 100644 --- a/util/rtt.h +++ b/util/rtt.h @@ -56,7 +56,7 @@ struct rtt_info { }; /** min retransmit timeout value, in milliseconds */ -#define RTT_MIN_TIMEOUT 2000 +#define RTT_MIN_TIMEOUT 50 /** max retransmit timeout value, in milliseconds */ #define RTT_MAX_TIMEOUT 120000 -- 2.47.2