From: Otto Moerbeek Date: Tue, 19 Sep 2023 07:24:52 +0000 (+0200) Subject: Small fixes in comments and log messages from review X-Git-Tag: rec-5.0.0-alpha2~58^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbe7b146f967e98a516f4ecb1df6057bf67724d8;p=thirdparty%2Fpdns.git Small fixes in comments and log messages from review --- diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index dc192506f5..9303399531 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -223,8 +223,8 @@ int RecThreadInfo::runThreads(Logr::log_t log) const auto cpusMap = parseCPUMap(log); if (RecThreadInfo::numDistributors() + RecThreadInfo::numUDPWorkers() == 1) { - SLOG(g_log << Logger::Warning << "Operating with single distributor/worker thread" << endl, - log->info(Logr::Notice, "Operating with single distributor/worker thread")); + SLOG(g_log << Logger::Warning << "Operating with single UDP distributor/worker thread" << endl, + log->info(Logr::Notice, "Operating with single UDP distributor/worker thread")); /* This thread handles the web server, carbon, statistics and the control channel */ unsigned int currentThreadId = 0; diff --git a/pdns/recursordist/rec-tcp.cc b/pdns/recursordist/rec-tcp.cc index a5a921cd49..ca3c3b3e36 100644 --- a/pdns/recursordist/rec-tcp.cc +++ b/pdns/recursordist/rec-tcp.cc @@ -27,6 +27,8 @@ #include "mplexer.hh" #include "uuid-utils.hh" +// OLD PRE 5.0.0 situation: +// // When pdns-distributes-queries is false with reuseport true (the default since 4.9.0), TCP queries // are read and handled by worker threads. If the kernel balancing is OK for TCP sockets (observed // to be good on Debian bullseye, but not good on e.g. MacOS), the TCP handling is no extra burden. @@ -34,7 +36,7 @@ // queries do get distributed round-robin over the worker threads. Do note the TCP queries might // need to wait until the g_maxUDPQueriesPerRound is reached. // -// In the case of pdns-distributes-queries true and reuseport false the queries are read and +// In the case of pdns-distributes-queries true and reuseport false the queries were read and // initially processed by the distributor thread(s). // // Initial processing consist of parsing, calling gettag and checking if we have a packet cache @@ -43,18 +45,20 @@ // final answer will be sent by the same distributor thread that originally picked up the query. // // Changing this, and having incoming TCP queries handled by worker threads is somewhat more complex -// than UDP, as the socket must remain avaiable in the distributor thread (for reading more +// than UDP, as the socket must remain available in the distributor thread (for reading more // queries), but the TCP socket must also be passed to a worker thread so it can write its // answer. The in-flight bookkeeping also has to be aware of how a query is handled to do the // accounting properly. I am not sure if changing the current setup is worth all this trouble, // especially since the default is now to not use pdns-distributes-queries, which works well in many // cases. // +// NEW SITUATION SINCE 5.0.0: +// // The drawback mentioned in https://github.com/PowerDNS/pdns/issues/8394 are not longer true, so an // alternative approach would be to introduce dedicated TCP worker thread(s). // -// And this approach was implemented in https://github.com/PowerDNS/pdns/pull/13195. The distributor -// and worker thread(s) now no longe process TCP queries. +// This approach was implemented in https://github.com/PowerDNS/pdns/pull/13195. The distributor and +// worker thread(s) now no longer process TCP queries. size_t g_tcpMaxQueriesPerConn; unsigned int g_maxTCPPerClient;