2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Merge branch '2075-add-T-maxcachesize-command-line-option' into 'main'

Add "-T maxcachesize=..." command line option

Closes #2075

See merge request isc-projects/bind9!4043
This commit is contained in:
Michał Kępień 2020-08-31 21:40:28 +00:00
commit fcd6962e8b
45 changed files with 42 additions and 43 deletions

View File

@ -143,6 +143,7 @@ EXTERN bool named_g_memstatistics INIT(false);
EXTERN bool named_g_keepstderr INIT(false); EXTERN bool named_g_keepstderr INIT(false);
EXTERN unsigned int named_g_tat_interval INIT(24 * 3600); EXTERN unsigned int named_g_tat_interval INIT(24 * 3600);
EXTERN unsigned int named_g_maxcachesize INIT(0);
#if defined(HAVE_GEOIP2) #if defined(HAVE_GEOIP2)
EXTERN dns_geoip_databases_t *named_g_geoip INIT(NULL); EXTERN dns_geoip_databases_t *named_g_geoip INIT(NULL);

View File

@ -650,6 +650,8 @@ parse_T_opt(char *option) {
named_g_nosyslog = true; named_g_nosyslog = true;
} else if (!strcmp(option, "notcp")) { } else if (!strcmp(option, "notcp")) {
notcp = true; notcp = true;
} else if (!strncmp(option, "maxcachesize=", 13)) {
named_g_maxcachesize = atoi(option + 13);
} else if (!strcmp(option, "maxudp512")) { } else if (!strcmp(option, "maxudp512")) {
maxudp = 512; maxudp = 512;
} else if (!strcmp(option, "maxudp1460")) { } else if (!strcmp(option, "maxudp1460")) {

View File

@ -4114,7 +4114,16 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
obj = NULL; obj = NULL;
result = named_config_get(maps, "max-cache-size", &obj); result = named_config_get(maps, "max-cache-size", &obj);
INSIST(result == ISC_R_SUCCESS); INSIST(result == ISC_R_SUCCESS);
if (cfg_obj_isstring(obj)) { /*
* If "-T maxcachesize=..." is in effect, it overrides any other
* "max-cache-size" setting found in configuration, either implicit or
* explicit. For simplicity, the value passed to that command line
* option is always treated as the number of bytes to set
* "max-cache-size" to.
*/
if (named_g_maxcachesize != 0) {
max_cache_size = named_g_maxcachesize;
} else if (cfg_obj_isstring(obj)) {
str = cfg_obj_asstring(obj); str = cfg_obj_asstring(obj);
INSIST(strcasecmp(str, "unlimited") == 0); INSIST(strcasecmp(str, "unlimited") == 0);
max_cache_size = 0; max_cache_size = 0;

View File

@ -1,2 +1,2 @@
# this server runs named with only one worker thread # this server runs named with only one worker thread
-m record,size,mctx -c named.conf -d 99 -D additional-ns1 -X named.lock -g -n 1 -m record,size,mctx -c named.conf -d 99 -D additional-ns1 -X named.lock -g -n 1 -T maxcachesize=2097152

View File

@ -1,2 +1,2 @@
# this server only has 127.0.0.1 in its localhost/localnets ACLs # this server only has 127.0.0.1 in its localhost/localnets ACLs
-m record,size,mctx -c named.conf -d 99 -D allow-query-ns3 -X named.lock -g -T fixedlocal -m record,size,mctx -c named.conf -d 99 -D allow-query-ns3 -X named.lock -g -T maxcachesize=2097152 -T fixedlocal

View File

@ -18,7 +18,6 @@ options {
listen-on { 10.53.0.2; }; listen-on { 10.53.0.2; };
listen-on-v6 { none; }; listen-on-v6 { none; };
notify yes; notify yes;
max-cache-size 80%;
disable-empty-zone 127.IN-ADDR.ARPA; disable-empty-zone 127.IN-ADDR.ARPA;
recursion yes; recursion yes;
dnssec-validation yes; dnssec-validation yes;

View File

@ -1 +1 @@
-D delzone-ns2 -X named.lock -m record,size,mctx -c named.conf -g -U 4 -D delzone-ns2 -X named.lock -m record,size,mctx -c named.conf -g -U 4 -T maxcachesize=2097152

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dnssec-ns6 -X named.lock -g -T nonearest -T tat=1 -m record,size,mctx -c named.conf -d 99 -D dnssec-ns6 -X named.lock -g -T maxcachesize=2097152 -T nonearest -T tat=1

View File

@ -1,2 +1,2 @@
# Using "-n 1" allows GL #1795 to be reliably reproduced # Using "-n 1" allows GL #1795 to be reliably reproduced
-D dnstap-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -n 1 -D dnstap-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -n 1 -T maxcachesize=2097152

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns1 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns1 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns2 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns2 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns3 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns3 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns4 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns5 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns6 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D dscp-ns7 -X named.lock -g -U 4 -T dscp=46 -m record,size,mctx -c named.conf -d 99 -D dscp-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46

View File

@ -1 +1 @@
-D dupsigs-ns1 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T sigvalinsecs -D dupsigs-ns1 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T sigvalinsecs

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -27,7 +27,6 @@ options {
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
blackhole { blocking; }; blackhole { blocking; };
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -22,7 +22,6 @@ options {
recursion no; recursion no;
dnssec-validation no; dnssec-validation no;
geoip-directory "../data"; geoip-directory "../data";
max-cache-size 1M;
}; };
key rndc_key { key rndc_key {

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D legacy-ns4 -X named.lock -g -U 4 -T noedns -m record,size,mctx -c named.conf -d 99 -D legacy-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D legacy-ns5 -X named.lock -g -U 4 -T noedns -m record,size,mctx -c named.conf -d 99 -D legacy-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D legacy-ns6 -X named.lock -g -U 4 -T maxudp512 -m record,size,mctx -c named.conf -d 99 -D legacy-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D legacy-ns7 -X named.lock -g -U 4 -T maxudp512 -m record,size,mctx -c named.conf -d 99 -D legacy-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512

View File

@ -1 +1 @@
-D mirror-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T tat=3 -D mirror-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T tat=3

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D mkeys-ns2 -X named.lock -g -T mkeytimers=5/10/20 -T tat=1 -m record,size,mctx -c named.conf -d 99 -D mkeys-ns2 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 -T tat=1

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D mkeys-ns3 -X named.lock -g -T mkeytimers=5/10/20 -m record,size,mctx -c named.conf -d 99 -D mkeys-ns3 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -X named.lock -g -m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -X named.lock -g -T mkeytimers=2/20/40 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=2/20/40

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -X named.lock -g -T mkeytimers=5/10/20 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20

View File

@ -1 +1 @@
-D nsupdate-ns5 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T fixedlocal -D nsupdate-ns5 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal

View File

@ -1 +1 @@
-D nsupdate-ns6 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T fixedlocal -D nsupdate-ns6 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal

View File

@ -1,3 +1,3 @@
# teardown of a huge zone with tracing enabled takes way too long # teardown of a huge zone with tracing enabled takes way too long
# -m none is set so that stop.pl does not timeout # -m none is set so that stop.pl does not timeout
-D rndc-ns6 -X named.lock -m none -c named.conf -d 99 -g -U 4 -D rndc-ns6 -X named.lock -m none -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152

View File

@ -1,2 +1,2 @@
# run the performance test close to real life # run the performance test close to real life
-c named.conf -D rpz-ns5 -X named.lock -gd3 -c named.conf -D rpz-ns5 -X named.lock -gd3 -T maxcachesize=2097152

View File

@ -1 +1 @@
-m record,size,mctx -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -m record,size,mctx -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -T maxcachesize=2097152

View File

@ -268,7 +268,7 @@ sub construct_ns_command {
} }
} }
$command .= "-c named.conf -d 99 -g -U 4"; $command .= "-c named.conf -d 99 -g -U 4 -T maxcachesize=2097152";
} }
if (-e "$testdir/$server/named.notcp") { if (-e "$testdir/$server/named.notcp") {