From d5ee9d24479887301c8f4d4a7ac1340fc7e712db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 1 Feb 2023 09:42:05 +0100 Subject: [PATCH] Bump the recursive-clients default to 1000000 Increase the default value of recursive-clients to one million. The server can handle this just fine, and we need to avoid the situation where too many clients are stuck on the unresponsive fetches. --- bin/named/config.c | 2 +- bin/named/server.c | 16 +++------------- doc/arm/reference.rst | 13 +++++++------ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/bin/named/config.c b/bin/named/config.c index 470d36cb71..3d33d917c5 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -99,7 +99,7 @@ options {\n\ "\ prefetch 2 9;\n\ recursing-file \"named.recursing\";\n\ - recursive-clients 1000;\n\ + recursive-clients 100000;\n\ request-nsid false;\n\ reserved-sockets 512;\n\ resolver-query-timeout 10;\n\ diff --git a/bin/named/server.c b/bin/named/server.c index bce0fab354..c4041b1e48 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8586,19 +8586,9 @@ load_configuration(const char *filename, named_server_t *server, configure_server_quota(maps, "update-quota", &server->sctx->updquota); max = isc_quota_getmax(&server->sctx->recursionquota); - if (max > 1000) { - unsigned int margin = ISC_MAX(100, named_g_cpus + 1); - if (margin + 100 > max) { - isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, - NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, - "'recursive-clients %d' too low when " - "running with %d worker threads", - max, named_g_cpus); - result = ISC_R_RANGE; - - goto cleanup_bindkeys_parser; - } - softquota = max - margin; + if (max < 1000) { + isc_quota_max(&server->sctx->recursionquota, 1000); + softquota = 900; } else { softquota = (max * 90) / 100; } diff --git a/doc/arm/reference.rst b/doc/arm/reference.rst index 8b5fa974ba..665bfd154f 100644 --- a/doc/arm/reference.rst +++ b/doc/arm/reference.rst @@ -3641,9 +3641,12 @@ system. :tags: query :short: Specifies the maximum number of concurrent recursive queries the server can perform. - This sets the maximum number (a "hard quota") of simultaneous recursive lookups - the server performs on behalf of clients. The default is - ``1000``. Because each recursing client uses a fair bit of memory (on + This sets the maximum number (a "hard quota") of simultaneous recursive + lookups the server performs on behalf of clients. The default is ``1000000`` + (one million). The minimum is ``1000``. Values below the minimum are + adjusted to the minimum value. + + Because each recursing client uses a fair bit of memory (on the order of 20 kilobytes), the value of the :any:`recursive-clients` option may have to be decreased on hosts with limited memory. @@ -3654,9 +3657,7 @@ system. A "soft quota" is also set. When this lower quota is exceeded, incoming requests are accepted, but for each one, a pending request - is dropped. If :any:`recursive-clients` is greater than 1000, the - soft quota is set to :any:`recursive-clients` minus 100; otherwise it is - set to 90% of :any:`recursive-clients`. + is dropped. The soft quota is set to 90% of :any:`recursive-clients`. .. namedconf:statement:: tcp-clients :tags: server