[v9_9] 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]

(cherry picked from commit 83eecff731)
This commit is contained in:
Evan Hunt
2014-02-19 21:57:30 -08:00
parent be2d413edf
commit e1415ccd1d
3 changed files with 18 additions and 6 deletions
+4
View File
@@ -1,3 +1,7 @@
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]
3747. [bug] A race condition could lead to a core dump when
destroying a resolver fetch object. [RT #35385]
+8 -2
View File
@@ -621,8 +621,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
+6 -4
View File
@@ -291,10 +291,12 @@
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>