From 83eecff731c1a049b12f01fb699fa15ab7ddac2e Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 19 Feb 2014 21:54:43 -0800 Subject: [PATCH] [master] adjust default -U 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 | 4 ++++ bin/named/main.c | 10 ++++++++-- bin/named/named.docbook | 10 ++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index bd3faf5184..06a30c54b0 100644 --- 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. diff --git a/bin/named/main.c b/bin/named/main.c index f9eaf7c281..b1951efb39 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -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 diff --git a/bin/named/named.docbook b/bin/named/named.docbook index f70787b142..307be93fe8 100644 --- a/bin/named/named.docbook +++ b/bin/named/named.docbook @@ -314,10 +314,12 @@ Use #listeners worker threads to listen for incoming UDP packets on each address. If not specified, named will - use the number of detected CPUs. If - has been set to a higher value than the number of CPUs, - then 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 has been set to a higher value than + the number of detected CPUs, then may + be increased as high as that value, but no higher.