From: Wouter Wijngaards Date: Wed, 20 Oct 2010 08:19:05 +0000 (+0000) Subject: Jostle time used to estimate roundtrip. X-Git-Tag: release-1.4.7rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea85e235166969f8b990e52cbc399aa165de5c77;p=thirdparty%2Funbound.git Jostle time used to estimate roundtrip. git-svn-id: file:///svn/unbound/trunk@2301 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/services/cache/infra.c b/services/cache/infra.c index a43c22b0b..99e48087a 100644 --- a/services/cache/infra.c +++ b/services/cache/infra.c @@ -102,6 +102,7 @@ infra_create(struct config_file* cfg) infra->host_ttl = cfg->host_ttl; infra->lame_ttl = cfg->lame_ttl; infra->max_lame_size = cfg->infra_cache_lame_size; + infra->jostle = cfg->jostle_time; return infra; } @@ -123,6 +124,7 @@ infra_adjust(struct infra_cache* infra, struct config_file* cfg) infra->host_ttl = cfg->host_ttl; infra->lame_ttl = cfg->lame_ttl; infra->max_lame_size = cfg->infra_cache_lame_size; + infra->jostle = cfg->jostle_time; maxmem = cfg->infra_cache_numhosts * (sizeof(struct infra_host_key)+sizeof(struct infra_host_data)); if(maxmem != slabhash_get_size(infra->hosts) || @@ -274,8 +276,8 @@ infra_host(struct infra_cache* infra, struct sockaddr_storage* addr, * The server seems to still reply but sporadically. * Perhaps it has rate-limited the traffic, or it * drops particular queries (AAAA). ignore timeouts, - * but we use an expanded variance of 6x. */ - *to = data->rtt.srtt + 6*data->rtt.rttvar; + * and use the jostle timeout for rtt estimate. */ + *to = infra->jostle; *edns_vs = data->edns_version; *edns_lame_known = data->edns_lame_known; lock_rw_unlock(&e->lock); diff --git a/services/cache/infra.h b/services/cache/infra.h index 80321b0e1..e70ed968f 100644 --- a/services/cache/infra.h +++ b/services/cache/infra.h @@ -120,6 +120,8 @@ struct infra_cache { int lame_ttl; /** infra lame cache max memory per host, in bytes */ size_t max_lame_size; + /** jostle timeout in msec */ + size_t jostle; }; /** infra host cache default hash lookup size */