log_info("server stats for thread %d: requestlist max %u avg %g "
"exceeded %u", threadnum, (unsigned)stats->max_query_list_size,
stats->num_queries_missed_cache?
- (double)stats->sum_query_list_size/
- stats->num_queries_missed_cache:0.0,
+ (double)stats->sum_query_list_size/
+ stats->num_queries_missed_cache : 0.0,
(unsigned)stats->num_query_list_exceeded);
}
+19 June 2007: Wouter
+ - nicer layout in stats.c, review 0.3 change.
+ - spelling improvement, review 0.3 change.
+ - uncapped timeout for server selection, so that very fast or slow
+ servers will stand out from the rest.
+ - target-fetch-policy: "3 2 1 0 0" config setting.
+
18 June 2007: Wouter
- same, move subqueries to slumber list when first has resolved.
- fixup last fix for duplicate callbacks.
# the pid file.
# pidfile: "unbound.pid"
+
+ # the target fetch policy.
+ # series of integers describing the policy per dependency depth.
+ # The number of values in the list determines the maximum dependency
+ # depth the recursor will pursue before giving up. Each integer means:
+ # -1 : fetch all targets opportunistically,
+ # 0: fetch on demand,
+ # positive value: fetch that many targets opportunistically.
+ # Enclose the list of numbers between quotes ("").
+ # target-fetch-policy: "3 2 1 0 0"
# Stub zones.
# Create entries like below, to make all queries for 'example.com' and
The process id is written to the file. Default is "unbound.pid". So,
kill -HUP `cat /etc/unbound/unbound.pid` will trigger a reload,
kill -QUIT `cat /etc/unbound/unbound.pid` will gracefully terminate.
+.It \fBtarget-fetch-policy:\fR <"list of numbers">
+Set the target fetch policy used by unbound to determine if it should fetch
+nameserver target addresses opportunistically. The policy is described per
+dependency depth. The number of values determines the maximum dependency depth
+that unbound will pursue in answering a query.
+A value of -1 means to fetch all targets opportunistically for that dependency
+depth. A value of 0 means to fetch on demand only. A positive value fetches
+that many targets opportunistically. Enclose the list between quotes ("").
+The default is "3 2 1 0 0". Setting all zeroes, "0 0 0 0 0" gives behaviour
+closer to that of BIND 9, while setting "-1 -1 -1 -1 -1" gives behaviour
+rumoured to be closer to that of BIND 8.
.El
.Ss Stub Zone Options
if(!e)
return 0;
host = (struct infra_host_data*)e->data;
- *rtt = rtt_timeout(&host->rtt);
+ *rtt = rtt_unclamped(&host->rtt);
/* check lameness first, if so, ttl on host does not matter anymore */
if(infra_lookup_lame(host, name, namelen, timenow)) {
lock_rw_unlock(&e->lock);
* @param namelen: zone name length.
* @param lame: if function returns true, this returns lameness of the zone.
* @param rtt: if function returns true, this returns avg rtt of the server.
+ * The rtt value is unclamped and reflects recent timeouts.
* @param timenow: what time it is now.
* @return if found in cache, or false if not (or TTL bad).
*/
/**
* Array of tcp pending used for outgoing TCP connections.
* Each can be used to establish a TCP connection with a server.
- * The file descriptors are -1 if its free, need to be opened for
- * the tcp connection. Can be used for ip4 and ip6.
+ * The file descriptors are -1 if they are free, and need to be
+ * opened for the tcp connection. Can be used for ip4 and ip6.
*/
struct pending_tcp **tcp_conns;
/** number of tcp communication points. */
infra-cache-numhosts{COLON} { YDOUT; return VAR_INFRA_CACHE_NUMHOSTS;}
infra-cache-numlame{COLON} { YDOUT; return VAR_INFRA_CACHE_NUMLAME;}
num-queries-per-thread{COLON} { YDOUT; return VAR_NUM_QUERIES_PER_THREAD;}
+target-fetch-policy{COLON} { YDOUT; return VAR_TARGET_FETCH_POLICY;}
stub-zone{COLON} { YDOUT; return VAR_STUB_ZONE;}
name{COLON} { YDOUT; return VAR_NAME;}
stub-addr{COLON} { YDOUT; return VAR_STUB_ADDR;}
%token VAR_RRSET_CACHE_SIZE VAR_RRSET_CACHE_SLABS VAR_OUTGOING_NUM_TCP
%token VAR_INFRA_HOST_TTL VAR_INFRA_LAME_TTL VAR_INFRA_CACHE_SLABS
%token VAR_INFRA_CACHE_NUMHOSTS VAR_INFRA_CACHE_NUMLAME VAR_NAME
-%token VAR_STUB_ZONE VAR_STUB_HOST VAR_STUB_ADDR
+%token VAR_STUB_ZONE VAR_STUB_HOST VAR_STUB_ADDR VAR_TARGET_FETCH_POLICY
%%
toplevelvars: /* empty */ | toplevelvars toplevelvar ;
server_rrset_cache_slabs | server_outgoing_num_tcp |
server_infra_host_ttl | server_infra_lame_ttl |
server_infra_cache_slabs | server_infra_cache_numhosts |
- server_infra_cache_numlame | stubstart contents_stub
+ server_infra_cache_numlame | stubstart contents_stub |
+ server_target_fetch_policy
;
stubstart: VAR_STUB_ZONE
{
free($2);
}
;
+server_target_fetch_policy: VAR_TARGET_FETCH_POLICY STRING
+ {
+ OUTYY(("P(server_target_fetch_policy:%s)\n", $2));
+ free(cfg_parser->cfg->target_fetch_policy);
+ cfg_parser->cfg->target_fetch_policy = $2;
+ }
+ ;
stub_name: VAR_NAME STRING
{
OUTYY(("P(name:%s)\n", $2));
return rtt->rto;
}
+int
+rtt_unclamped(const struct rtt_info* rtt)
+{
+ if(calc_rto(rtt) != rtt->rto) {
+ /* timeout fallback has happened */
+ return rtt->rto;
+ }
+ /* return unclamped value */
+ return rtt->srtt + 4*rtt->rttvar;
+}
+
void
rtt_update(struct rtt_info* rtt, int ms)
{
*/
int rtt_timeout(const struct rtt_info* rtt);
+/**
+ * Get unclamped timeout to use for server selection.
+ * Recent timeouts are reflected in the returned value.
+ * @param rtt: round trip statistics structure.
+ * @return: value to use in milliseconds.
+ */
+int rtt_unclamped(const struct rtt_info* rtt);
+
/**
* Update the statistics with a new roundtrip estimate observation.
* @param rtt: round trip statistics structure.