]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2457. [tuning] max-cache-size is reverted to 0, the previous
authorTatuya JINMEI 神明達哉 <jinmei@isc.org>
Sat, 27 Sep 2008 23:35:31 +0000 (23:35 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Sat, 27 Sep 2008 23:35:31 +0000 (23:35 +0000)
default.  It should be safe because expired cache
entries are also purged.

CHANGES
bin/named/config.c
bin/named/server.c
doc/arm/Bv9ARM-book.xml
lib/isccfg/namedconf.c

diff --git a/CHANGES b/CHANGES
index b39242ca69e5cdf8cf4abd8bf5450819af44ab42..2835d30fe0c79f015bf38ec90f0329aff864b802 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+2457.  [tuning]        max-cache-size is reverted to 0, the previous
+                       default.  It should be safe because expired cache
+                       entries are also purged.
+
 2456.  [bug]           In ACLs, ::/0 and 0.0.0.0/0 would both match any
                        address, regardless of family.  They now correctly
                        distinguish IPv4 from IPv6.  [RT #18559]
index 5ea0a114c184303ae36c8e569abf0d9279afab06..a85be69c51ab952534e99332aa5110b19f3d92d9 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.c,v 1.91 2008/09/24 02:46:21 marka Exp $ */
+/* $Id: config.c,v 1.92 2008/09/27 23:35:31 jinmei Exp $ */
 
 /*! \file */
 
@@ -131,7 +131,7 @@ options {\n\
        max-ncache-ttl 10800; /* 3 hours */\n\
        max-cache-ttl 604800; /* 1 week */\n\
        transfer-format many-answers;\n\
-#      max-cache-size default; /* set default in server.c */\n\
+       max-cache-size 0;\n\
        check-names master fail;\n\
        check-names slave warn;\n\
        check-names response ignore;\n\
index e3a2a0ebcb9ab5e3fb9076893d3920233f116ec8..639416d55c18c8399ffa5331efa8b48014a4ff7a 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.516 2008/09/04 23:47:13 tbox Exp $ */
+/* $Id: server.c,v 1.517 2008/09/27 23:35:31 jinmei Exp $ */
 
 /*! \file */
 
@@ -224,11 +224,6 @@ static const struct {
        { NULL, ISC_FALSE }
 };
 
-/*%
- * The default max-cache-size
- */
-#define NS_MAXCACHESIZE_DEFAULT        33554432 /*%< Bytes.  33554432 = 32MB */
-
 static void
 fatal(const char *msg, isc_result_t result);
 
@@ -1232,21 +1227,11 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
 
        obj = NULL;
        result = ns_config_get(maps, "max-cache-size", &obj);
-       INSIST(result == ISC_R_SUCCESS || result == ISC_R_NOTFOUND);
-       if (result == ISC_R_NOTFOUND) {
-               max_cache_size = NS_MAXCACHESIZE_DEFAULT;
-               isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
-                             NS_LOGMODULE_SERVER, ISC_LOG_INFO,
-                             "default max-cache-size (%u) applies%s%s",
-                             max_cache_size, sep, viewname);
-       } else if (cfg_obj_isstring(obj)) {
+       INSIST(result == ISC_R_SUCCESS);
+       if (cfg_obj_isstring(obj)) {
                str = cfg_obj_asstring(obj);
-               INSIST(strcasecmp(str, "unlimited") == 0 ||
-                      strcasecmp(str, "default") == 0);
-               if (strcasecmp(str, "unlimited") == 0)
-                       max_cache_size = ISC_UINT32_MAX;
-               else
-                       max_cache_size = NS_MAXCACHESIZE_DEFAULT;
+               INSIST(strcasecmp(str, "unlimited") == 0);
+               max_cache_size = ISC_UINT32_MAX;
        } else {
                isc_resourcevalue_t value;
                value = cfg_obj_asuint64(obj);
index 6a486d158c62c42f0bd305d947a82136efd28322..beeb83f4a8521c4ced287c1ff40e941b41eec68f 100644 (file)
@@ -18,7 +18,7 @@
  - PERFORMANCE OF THIS SOFTWARE.
 -->
 
-<!-- File: $Id: Bv9ARM-book.xml,v 1.371 2008/09/25 20:41:19 jreed Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.372 2008/09/27 23:35:31 jinmei Exp $ -->
 <book xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>BIND 9 Administrator Reference Manual</title>
 
@@ -6994,14 +6994,24 @@ avoid-v6-udp-ports { 40000; range 50000 60000; };
               <listitem>
                 <para>
                   The maximum amount of memory to use for the
-                  server's cache, in bytes.  When the amount of data in the
-                  cache
+                  server's cache, in bytes.
+                  When the amount of data in the cache
                   reaches this limit, the server will cause records to expire
-                  prematurely so that the limit is not exceeded.  In a server
-                  with
-                  multiple views, the limit applies separately to the cache of
-                  each
-                  view.  The default is <literal>32M</literal>.
+                  prematurely based on an LRU based strategy so that
+                  the limit is not exceeded.
+                  A value of 0 is special, meaning that
+                  records are purged from the cache only when their
+                  TTLs expire.
+                  Another special keyword <userinput>unlimited</userinput>
+                  means the maximum value of 32-bit unsigned integers
+                  (0xffffffff), which may not have the same effect as
+                  0 on machines that support more than 32 bits of
+                  memory space.
+                 Any positive values less than 2MB will be ignored reset
+                  to 2MB.
+                  In a server with multiple views, the limit applies
+                  separately to the cache of each view.
+                  The default is 0.
                 </para>
               </listitem>
             </varlistentry>
index e96258ce01150572440fa3cc32766e777773a42d..06104894642f87f8a66115e60b17bb691ab156e8 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: namedconf.c,v 1.91 2008/09/24 02:46:23 marka Exp $ */
+/* $Id: namedconf.c,v 1.92 2008/09/27 23:35:31 jinmei Exp $ */
 
 /*! \file */
 
@@ -820,7 +820,7 @@ view_clauses[] = {
        { "ixfr-from-differences", &cfg_type_ixfrdifftype, 0 },
        { "lame-ttl", &cfg_type_uint32, 0 },
        { "max-acache-size", &cfg_type_sizenodefault, 0 },
-       { "max-cache-size", &cfg_type_size, 0 },
+       { "max-cache-size", &cfg_type_sizenodefault, 0 },
        { "max-cache-ttl", &cfg_type_uint32, 0 },
        { "max-clients-per-query", &cfg_type_uint32, 0 },
        { "max-ncache-ttl", &cfg_type_uint32, 0 },