Rename the configuration option to load balance sockets to reuseport

After some back and forth, it was decidede to match the configuration
option with unbound ("so-reuseport"), PowerDNS ("reuseport") and/or
nginx ("reuseport").

(cherry picked from commit 7e71c4d0cc)
This commit is contained in:
Ondřej Surý 2022-04-06 17:00:24 +02:00
parent fd9a2fc0ba
commit a1f3ff0dd1
11 changed files with 31 additions and 34 deletions

View file

@ -2,8 +2,8 @@
crash if the connection to the first server was not
successful. [GL #3244]
5852. [func] Add new "load-balance-socket" option to
enable/disable load balancing of sockets. [GL #3249]
5852. [func] Add new "reuseport" option to enable/disable load
balancing of sockets. [GL #3249]
5848. [bug] dig could hang in some cases involving multiple servers
in a lookup, when a request fails and the next one

View file

@ -71,15 +71,7 @@ options {\n\
interface-interval 60;\n\
# keep-response-order {none;};\n\
listen-on {any;};\n\
listen-on-v6 {any;};\n"
#if HAVE_SO_REUSEPORT_LB
"\
load-balance-sockets yes;\n"
#else
"\
load-balance-sockets no;\n"
#endif
"\
listen-on-v6 {any;};\n\
# lock-file \"" NAMED_LOCALSTATEDIR "/run/named/named.lock\";\n\
match-mapped-addresses no;\n\
max-ixfr-ratio 100%;\n\
@ -91,7 +83,15 @@ options {\n\
nta-lifetime 3600;\n\
nta-recheck 300;\n\
# pid-file \"" NAMED_LOCALSTATEDIR "/run/named/named.pid\"; \n\
port 53;\n\
port 53;\n"
#if HAVE_SO_REUSEPORT_LB
"\
reuseport yes;\n"
#else
"\
reuseport no;\n"
#endif
"\
tls-port 853;\n"
#if HAVE_LIBNGHTTP2
"\

View file

@ -301,7 +301,6 @@ OPTIONS
string ] {
address_match_element; ... };
lmdb-mapsize sizeval;
load-balance-sockets boolean;
lock-file ( quoted_string | none );
managed-keys-directory quoted_string;
masterfile-format ( raw | text );
@ -411,6 +410,7 @@ OPTIONS
[ nsip-enable boolean ] [ nsdname-enable boolean ] [
dnsrps-enable boolean ] [ dnsrps-options { unspecified-text
} ];
reuseport boolean;
root-delegation-only [ exclude { string; ... } ];
root-key-sentinel boolean;
rrset-order { [ class string ] [ type string ] [ name

View file

@ -8975,7 +8975,7 @@ load_configuration(const char *filename, named_server_t *server,
ns_interfacemgr_setbacklog(server->interfacemgr, backlog);
obj = NULL;
result = named_config_get(maps, "load-balance-sockets", &obj);
result = named_config_get(maps, "reuseport", &obj);
INSIST(result == ISC_R_SUCCESS);
loadbalancesockets = cfg_obj_asboolean(obj);
#if HAVE_SO_REUSEPORT_LB
@ -8985,14 +8985,12 @@ load_configuration(const char *filename, named_server_t *server,
} else if (loadbalancesockets !=
isc_nm_getloadbalancesockets(named_g_netmgr)) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"changing load-balance-sockets value requires "
"server restart");
"changing reuseport value requires server restart");
}
#else
if (loadbalancesockets) {
cfg_obj_log(
obj, named_g_lctx, ISC_LOG_WARNING,
"load-balance-sockets has no effect on this system");
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"reuseport has no effect on this system");
}
#endif

View file

@ -1726,17 +1726,16 @@ Boolean Options
If ``yes``, respond to root key sentinel probes as described in
draft-ietf-dnsop-kskroll-sentinel-08. The default is ``yes``.
``load-balance-sockets``
``reuseport``
This option enables kernel load-balancing of sockets on systems which support
it, including Linux and FreeBSD. This instructs the kernel to distribute
incoming socket connections among the networking threads based on a hashing
scheme. For more information, see the receive network flow classification
options (``rx-flow-hash``) section in the ``ethtool`` manual page. The
default is ``yes``.
it, including Linux (SO_REUSEPORT) and FreeBSD (SO_REUSEPORT_LB). This
instructs the kernel to distribute incoming socket connections among the
networking threads based on a hashing scheme. For more information, see the
receive network flow classification options (``rx-flow-hash``) section in the
``ethtool`` manual page. The default is ``yes``.
Enabling ``load-balance-sockets`` significantly increases general throughput
when incoming traffic is distributed uniformly onto the threads by the
Enabling ``reuseport`` significantly increases general throughput when
incoming traffic is distributed uniformly onto the threads by the
operating system. However, in cases where a worker thread is busy with a
long-lasting operation, such as processing a Response Policy Zone (RPZ) or
Catalog Zone update or an unusually large zone transfer, incoming traffic

View file

@ -351,7 +351,6 @@ options {
string ] {
address_match_element; ... };
lmdb\-mapsize sizeval;
load\-balance\-sockets boolean;
lock\-file ( quoted_string | none );
managed\-keys\-directory quoted_string;
masterfile\-format ( raw | text );
@ -461,6 +460,7 @@ options {
[ nsip\-enable boolean ] [ nsdname\-enable boolean ] [
dnsrps\-enable boolean ] [ dnsrps\-options { unspecified\-text
} ];
reuseport boolean;
root\-delegation\-only [ exclude { string; ... } ];
root\-key\-sentinel boolean;
rrset\-order { [ class string ] [ type string ] [ name

View file

@ -217,7 +217,6 @@ options {
<string> ] {
<address_match_element>; ... }; // may occur multiple times
lmdb-mapsize <sizeval>;
load-balance-sockets <boolean>;
lock-file ( <quoted_string> | none );
managed-keys-directory <quoted_string>;
masterfile-format ( raw | text );
@ -328,6 +327,7 @@ options {
[ nsip-enable <boolean> ] [ nsdname-enable <boolean> ] [
dnsrps-enable <boolean> ] [ dnsrps-options { <unspecified-text>
} ];
reuseport <boolean>;
root-delegation-only [ exclude { <string>; ... } ];
root-key-sentinel <boolean>;
rrset-order { [ class <string> ] [ type <string> ] [ name

View file

@ -216,7 +216,6 @@ options {
<string> ] {
<address_match_element>; ... }; // may occur multiple times
lmdb-mapsize <sizeval>;
load-balance-sockets <boolean>;
lock-file ( <quoted_string> | none );
managed-keys-directory <quoted_string>;
masterfile-format ( raw | text );
@ -326,6 +325,7 @@ options {
[ nsip-enable <boolean> ] [ nsdname-enable <boolean> ] [
dnsrps-enable <boolean> ] [ dnsrps-options { <unspecified-text>
} ];
reuseport <boolean>;
root-delegation-only [ exclude { <string>; ... } ];
root-key-sentinel <boolean>;
rrset-order { [ class <string> ] [ type <string> ] [ name

View file

@ -153,7 +153,6 @@
<string> ] {
<address_match_element>; ... };
lmdb-mapsize <sizeval>;
load-balance-sockets <boolean>;
lock-file ( <quoted_string> | none );
managed-keys-directory <quoted_string>;
masterfile-format ( raw | text );
@ -263,6 +262,7 @@
[ nsip-enable <boolean> ] [ nsdname-enable <boolean> ] [
dnsrps-enable <boolean> ] [ dnsrps-options { <unspecified-text>
} ];
reuseport <boolean>;
root-delegation-only [ exclude { <string>; ... } ];
root-key-sentinel <boolean>;
rrset-order { [ class <string> ] [ type <string> ] [ name

View file

@ -37,7 +37,7 @@ Feature Changes
- None.
- Add a new configuration option ``load-balance-sockets`` to disable
- Add a new configuration option ``reuseport`` to disable
load balancing on sockets in scenarios in which processing of
Response Policy Zones (RPZ), Catalog Zones, or large zone transfers
can cause service disruptions. See the BIND 9 ARM for more detail.

View file

@ -1278,7 +1278,6 @@ static cfg_clausedef_t options_clauses[] = {
{ "keep-response-order", &cfg_type_bracketed_aml, 0 },
{ "listen-on", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI },
{ "listen-on-v6", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI },
{ "load-balance-sockets", &cfg_type_boolean, 0 },
{ "lock-file", &cfg_type_qstringornone, 0 },
{ "managed-keys-directory", &cfg_type_qstring, 0 },
{ "match-mapped-addresses", &cfg_type_boolean, 0 },
@ -1308,6 +1307,7 @@ static cfg_clausedef_t options_clauses[] = {
{ "random-device", &cfg_type_qstringornone, 0 },
{ "recursing-file", &cfg_type_qstring, 0 },
{ "recursive-clients", &cfg_type_uint32, 0 },
{ "reuseport", &cfg_type_boolean, 0 },
{ "reserved-sockets", &cfg_type_uint32, CFG_CLAUSEFLAG_DEPRECATED },
{ "secroots-file", &cfg_type_qstring, 0 },
{ "serial-queries", NULL, CFG_CLAUSEFLAG_ANCIENT },