]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Reduce the default value for max-stale-ttl from 1 week to 12 hours
authorOndřej Surý <ondrej@isc.org>
Wed, 27 May 2020 15:48:39 +0000 (17:48 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 3 Jun 2020 07:48:54 +0000 (09:48 +0200)
Originally, the default value for max-stale-ttl was 1 week, which could
and in some scenarios lead to cache exhaustion on a busy resolvers.
Picking the default value will always be juggling between value that's
useful (e.g. keeping the already cached records after they have already
expired and the upstream name servers are down) and not bloating the
cache too much (e.g. keeping everything for a very long time).  The new
default reflects what we think is a reasonable to time to react on both
sides (upstream authoritative and downstream recursive).

bin/named/config.c
bin/tests/system/serve-stale/tests.sh
doc/arm/reference.rst

index 121ddd1c128b8211ff816d590b97f8856b81d176..b32a8a05c4247d88e7fa4fae5b87f145ef77a67d 100644 (file)
@@ -170,7 +170,7 @@ options {\n\
        max-ncache-ttl 10800; /* 3 hours */\n\
        max-recursion-depth 7;\n\
        max-recursion-queries 75;\n\
-       max-stale-ttl 604800; /* 1 week */\n\
+       max-stale-ttl 43200; /* 12 hours */\n\
        message-compression yes;\n\
        min-ncache-ttl 0; /* 0 hours */\n\
        min-cache-ttl 0; /* 0 seconds */\n\
index e1a671dd5678433d84e0517fcbb639aa91ad8fb5..c85fcfe28a3f52229b0e6a484f261477360f92a9 100755 (executable)
@@ -21,6 +21,8 @@ waitfile () {
     done
 }
 
+max_stale_ttl=$(sed -ne 's,^[[:space:]]*max-stale-ttl \([[:digit:]]*\).*,\1,p' $TOP_SRCDIR/bin/named/config.c)
+
 status=0
 n=0
 
@@ -723,7 +725,7 @@ n=$((n+1))
 echo_i "check 'rndc serve-stale status' ($n)"
 ret=0
 $RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
-grep '_default: off (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1
+grep "_default: off (stale-answer-ttl=1 max-stale-ttl=$max_stale_ttl)" rndc.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
@@ -804,7 +806,7 @@ n=$((n+1))
 echo_i "check 'rndc serve-stale status' ($n)"
 ret=0
 $RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1
-grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1
+grep "_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=$max_stale_ttl)" rndc.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
@@ -951,7 +953,7 @@ n=$((n+1))
 echo_i "check 'rndc serve-stale status' ($n)"
 ret=0
 $RNDCCMD 10.53.0.4 serve-stale status > rndc.out.test$n 2>&1 || ret=1
-grep '_default: off (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1
+grep "_default: off (stale-answer-ttl=1 max-stale-ttl=$max_stale_ttl)" rndc.out.test$n > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=$((status+ret))
 
index aa4eedf86ef6cf35d0c54bdd23e3191ae43c2c11..bfd18095b1386b5c27983029410702cd78156850 100644 (file)
@@ -3264,7 +3264,7 @@ Tuning
    If stale answers are enabled, ``max-stale-ttl`` sets the maximum time
    for which the server retains records past their normal expiry to
    return them as stale records, when the servers for those records are
-   not reachable. The default is 1 week. The minimum allowed is 1
+   not reachable. The default is 12 hours. The minimum allowed is 1
    second; a value of 0 is updated silently to 1 second.
 
    For stale answers to be returned, they must be enabled, either in the