]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] adjust default -U
authorEvan Hunt <each@isc.org>
Thu, 20 Feb 2014 05:54:43 +0000 (21:54 -0800)
committerEvan Hunt <each@isc.org>
Thu, 20 Feb 2014 05:54:43 +0000 (21:54 -0800)
3751. [tuning] The default setting for the -U option (setting
the number of UDP listeners per interface) has
been adjusted to improve performance. [RT #35417]

CHANGES
bin/named/main.c
bin/named/named.docbook

diff --git a/CHANGES b/CHANGES
index bd3faf5184f26b3196bd346e10a50de2dc4e3a5e..06a30c54b06c48cdff30851c2d7776d92f43475d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
        --- 9.10.0b1 released ---
 
+3751.  [tuning]        The default setting for the -U option (setting
+                       the number of UDP listeners per interface) has
+                       been adjusted to improve performance. [RT #35417]
+
 3750.  [experimental]  Partially implement EDNS EXPIRE option as described
                        in draft-andrews-dnsext-expire-00.  Retrivial of
                        remaining time to expiry from slave zones is supported.
index f9eaf7c281e65a55c98767000dc451d45d5016bf..b1951efb39abc5e6b3953da011dbb45a609c6d2e 100644 (file)
@@ -646,8 +646,14 @@ create_managers(void) {
 #ifdef WIN32
        ns_g_udpdisp = 1;
 #else
-       if (ns_g_udpdisp == 0)
-               ns_g_udpdisp = ns_g_cpus_detected;
+       if (ns_g_udpdisp == 0) {
+               if (ns_g_cpus_detected == 1)
+                       ns_g_udpdisp = 1;
+               else if (ns_g_cpus_detected < 4)
+                       ns_g_udpdisp = 2;
+               else
+                       ns_g_udpdisp = ns_g_cpus_detected / 2;
+       }
        if (ns_g_udpdisp > ns_g_cpus)
                ns_g_udpdisp = ns_g_cpus;
 #endif
index f70787b142ccaa67a5eb4040434348067a2af2b7..307be93fe8252afaee0a4a9a776d39dde56932e1 100644 (file)
             Use <replaceable class="parameter">#listeners</replaceable>
             worker threads to listen for incoming UDP packets on each
             address.  If not specified, <command>named</command> will
-            use the number of detected CPUs.  If <option>-n</option>
-            has been set to a higher value than the number of CPUs,
-            then <option>-U</option> may be increased as high as that
-            value, but no higher.
+            calculate a default value based on the number of detected
+            CPUs: 1 for 1 CPU, 2 for 2-4 CPUs, and the number of
+            detected CPUs divided by 2 for values higher than 4.
+            If <option>-n</option> has been set to a higher value than
+            the number of detected CPUs, then <option>-U</option> may
+            be increased as high as that value, but no higher.
           </para>
         </listitem>
       </varlistentry>