- timeout on tcp does not lead to spurious leakage detect.
- account memory for name of lame zones, so that memory leakages does
not show lame cache growth as a leakage growth.
+ - config setting for lameness cache expressed in bytes, instead of
+ number of entries.
31 August 2007: Wouter
- can read bind trusted-keys { ... }; files, in a compatibility mode.
# the maximum number of hosts that are cached (roundtrip times, EDNS).
# infra-cache-numhosts: 10000
- # the maximum number of lame zones per host that are cached.
- # infra-cache-numlame: 1000
+ # the maximum size of the lame zones cached per host. in bytes.
+ # infra-cache-lame-size: 10240
# Enable IPv4, "yes" or "no".
# do-ip4: yes
by threads. Must be set to a power of 2.
.It \fBinfra-cache-numhosts:\fR <number>
Number of hosts for which information is cached. Default is 10000.
-.It \fBinfra-cache-numlame:\fR <number>
-Number of zones per host for which lameness is cached. Default is 1000.
+.It \fBinfra-cache-lame-size:\fR <number>
+Number of bytes that the lameness cache per host is allowed to use. Default
+is 10 kb, which gives maximum storage for a couple score zones, depending on
+the lame zone name lengths.
.It \fBdo-ip4:\fR <yes or no>
Enable or disable whether ip4 queries are answered. Default is yes.
.It \fBdo-ip6:\fR <yes or no>
}
infra->host_ttl = cfg->host_ttl;
infra->lame_ttl = cfg->lame_ttl;
- infra->max_lame = cfg->infra_cache_numlame;
+ infra->max_lame_size = cfg->infra_cache_lame_size;
return infra;
}
return infra_create(cfg);
infra->host_ttl = cfg->host_ttl;
infra->lame_ttl = cfg->lame_ttl;
- infra->max_lame = cfg->infra_cache_numlame;
+ infra->max_lame_size = cfg->infra_cache_lame_size;
maxmem = cfg->infra_cache_numhosts *
(sizeof(struct infra_host_key)+sizeof(struct infra_host_data));
if(maxmem != slabhash_get_size(infra->hosts) ||
if(!data->lameness) {
/* create hash table if not there already */
data->lameness = lruhash_create(INFRA_LAME_STARTSIZE,
- infra->max_lame*(sizeof(struct infra_lame_key)+
- sizeof(struct infra_lame_data)), infra_lame_sizefunc,
+ infra->max_lame_size, infra_lame_sizefunc,
infra_lame_compfunc, infra_lame_delkeyfunc,
infra_lame_deldatafunc, NULL);
if(!data->lameness) {
int host_ttl;
/** TTL for Lameness information, in seconds */
int lame_ttl;
- /** infra lame cache max memory per host, for this many entries */
- size_t max_lame;
+ /** infra lame cache max memory per host, in bytes */
+ size_t max_lame_size;
};
/** infra host cache default hash lookup size */
cfg->bogus_ttl = 900;
cfg->infra_cache_slabs = 4;
cfg->infra_cache_numhosts = 10000;
- cfg->infra_cache_numlame = 1000;
+ cfg->infra_cache_lame_size = 10240; /* easily 40 or more entries */
if(!(cfg->username = strdup(""))) goto error_exit;
if(!(cfg->chrootdir = strdup(""))) goto error_exit;
if(!(cfg->directory = strdup("/etc/unbound"))) goto error_exit;
size_t infra_cache_slabs;
/** max number of hosts in the infra cache */
size_t infra_cache_numhosts;
- /** max number of lame zones per host in the infra cache */
- size_t infra_cache_numlame;
+ /** max size of lame zones per host in the infra cache */
+ size_t infra_cache_lame_size;
/** the target fetch policy for the iterator */
char* target_fetch_policy;
infra-lame-ttl{COLON} { YDOUT; return VAR_INFRA_LAME_TTL;}
infra-cache-slabs{COLON} { YDOUT; return VAR_INFRA_CACHE_SLABS;}
infra-cache-numhosts{COLON} { YDOUT; return VAR_INFRA_CACHE_NUMHOSTS;}
-infra-cache-numlame{COLON} { YDOUT; return VAR_INFRA_CACHE_NUMLAME;}
+infra-cache-lame-size{COLON} { YDOUT; return VAR_INFRA_CACHE_LAME_SIZE;}
num-queries-per-thread{COLON} { YDOUT; return VAR_NUM_QUERIES_PER_THREAD;}
target-fetch-policy{COLON} { YDOUT; return VAR_TARGET_FETCH_POLICY;}
harden-short-bufsize{COLON} { YDOUT; return VAR_HARDEN_SHORT_BUFSIZE;}
%token VAR_MSG_CACHE_SIZE VAR_MSG_CACHE_SLABS VAR_NUM_QUERIES_PER_THREAD
%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_INFRA_CACHE_NUMHOSTS VAR_INFRA_CACHE_LAME_SIZE VAR_NAME
%token VAR_STUB_ZONE VAR_STUB_HOST VAR_STUB_ADDR VAR_TARGET_FETCH_POLICY
%token VAR_HARDEN_SHORT_BUFSIZE VAR_HARDEN_LARGE_QUERIES
%token VAR_FORWARD_ZONE VAR_FORWARD_HOST VAR_FORWARD_ADDR
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 | server_target_fetch_policy |
+ server_infra_cache_lame_size | server_target_fetch_policy |
server_harden_short_bufsize | server_harden_large_queries |
server_do_not_query_address | server_hide_identity |
server_hide_version | server_identity | server_version |
free($2);
}
;
-server_infra_cache_numlame: VAR_INFRA_CACHE_NUMLAME STRING
+server_infra_cache_lame_size: VAR_INFRA_CACHE_LAME_SIZE STRING
{
- OUTYY(("P(server_infra_cache_numlame:%s)\n", $2));
+ OUTYY(("P(server_infra_cache_lame_size:%s)\n", $2));
if(atoi($2) == 0)
yyerror("number expected");
- else cfg_parser->cfg->infra_cache_numlame = atoi($2);
+ else cfg_parser->cfg->infra_cache_lame_size = atoi($2);
free($2);
}
;