From: Otto Moerbeek Date: Tue, 18 Aug 2020 11:45:04 +0000 (+0200) Subject: Rename cache-shards to record-cache-shards and document it. X-Git-Tag: rec-4.4.0-beta1~30^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9390%2Fhead;p=thirdparty%2Fpdns.git Rename cache-shards to record-cache-shards and document it. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 95723348df..e50aa7682d 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -5133,7 +5133,7 @@ int main(int argc, char **argv) ::arg().setSwitch("qname-minimization", "Use Query Name Minimization")="yes"; ::arg().setSwitch("nothing-below-nxdomain", "When an NXDOMAIN exists in cache for a name with fewer labels than the qname, send NXDOMAIN without doing a lookup (see RFC 8020)")="dnssec"; ::arg().set("max-generate-steps", "Maximum number of $GENERATE steps when loading a zone from a file")="0"; - ::arg().set("cache-shards", "Number of shards in the record cache")="1024"; + ::arg().set("record-cache-shards", "Number of shards in the record cache")="1024"; #ifdef NOD_ENABLED ::arg().set("new-domain-tracking", "Track newly observed domains (i.e. never seen before).")="no"; @@ -5232,7 +5232,7 @@ int main(int argc, char **argv) exit(0); } - s_RC = std::unique_ptr(new MemRecursorCache(::arg().asNum("cache-shards"))); + s_RC = std::unique_ptr(new MemRecursorCache(::arg().asNum("record-cache-shards"))); Logger::Urgency logUrgency = (Logger::Urgency)::arg().asNum("loglevel"); diff --git a/pdns/recursordist/docs/settings.rst b/pdns/recursordist/docs/settings.rst index 81dc609653..d82c616988 100644 --- a/pdns/recursordist/docs/settings.rst +++ b/pdns/recursordist/docs/settings.rst @@ -1357,6 +1357,19 @@ Disabled by default, which also disables outgoing IPv6 support. Don't log queries. +.. _setting-record-cache-shards + +``record-cache-shards`` +------------------------ +.. versionadded:: 4.4.0 +- Integer +- Default: 1024 + +Sets the number of shards in the record cache. If you have high +contention as reported by +``record-cache-contented/record-cache-acquired``, you can try to +enlarge this value or run with fewer threads. + .. _setting-reuseport: ``reuseport`` diff --git a/regression-tests/recursor-test b/regression-tests/recursor-test index 184e5676d7..280d578a02 100755 --- a/regression-tests/recursor-test +++ b/regression-tests/recursor-test @@ -31,7 +31,7 @@ rm -f recursor.pid pdns_recursor.pid system CPU seconds%S wallclock seconds%e %% CPU used%P -' ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=$mthreads --query-local-address="0.0.0.0${QLA6}" --threads=$threads --cache-shards=$shards --disable-packetcache > recursor.log 2>&1 & +' ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=$mthreads --query-local-address="0.0.0.0${QLA6}" --threads=$threads --record-cache-shards=$shards --disable-packetcache > recursor.log 2>&1 & sleep 3 # warm up the cache