]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Introduce setting recursor.tcp_threads.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 11:47:40 +0000 (13:47 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 13 Sep 2023 11:47:40 +0000 (13:47 +0200)
While working on this, I noticed that after changing table.py
the new lib.rs is generated, but the Serde derives to not seem to get
triggered until afert I do a make clean. To be investigated.

pdns/recursordist/docs/settings.rst
pdns/recursordist/docs/yamlsettings.rst
pdns/recursordist/rec-main.cc
pdns/recursordist/settings/table.py

index 23682e1a01f82b18807d34078ddec68c200b8ae1..a6cda8236abaed4141a2303a5a03e1431c11ed13 100644 (file)
@@ -2744,6 +2744,18 @@ Maximum number of idle outgoing TCP/DoT connections per thread, 0 means do not k
 
 Spawn this number of threads on startup.
 
+.. _setting-tcp-threads:
+
+``tcp-threads``
+~~~~~~~~~~~~~~~
+
+-  Integer
+-  Default: 1
+
+- YAML setting: :ref:`setting-yaml-recursor.tcp_threads`
+
+Spawn this number of TCP processing threads on startup.
+
 .. _setting-trace:
 
 ``trace``
index ccaa639cc3dc7e298eff5f5e90073510e4e711f2..895dbf0040a4f3367527ada11067809d6e042e32 100644 (file)
@@ -2955,6 +2955,18 @@ Can be read out using ``rec_control top-remotes``.
 
 A sequence of statistic names, that are prevented from being exported via SNMP, for performance reasons.
 
+.. _setting-yaml-recursor.tcp_threads:
+
+``recursor.tcp_threads``
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+-  Integer
+-  Default: ``1``
+
+- Old style setting: :ref:`setting-tcp-threads`
+
+Spawn this number of TCP processing threads on startup.
+
 .. _setting-yaml-recursor.threads:
 
 ``recursor.threads``
index 0d863ff354d7c0260c3d9d347c44721bb3d0ec22..dc192506f5e73a8c9787ead995a7ee505d612cbf 100644 (file)
@@ -2129,10 +2129,10 @@ static int serviceMain(Logr::log_t log)
          log->info(Logr::Warning, "Asked to run with 0 threads, raising to 1 instead"));
     RecThreadInfo::setNumUDPWorkerThreads(1);
   }
-  RecThreadInfo::setNumTCPWorkerThreads(1); // XXX
+  RecThreadInfo::setNumTCPWorkerThreads(::arg().asNum("tcp-threads"));
   if (RecThreadInfo::numTCPWorkers() < 1) {
-    SLOG(g_log << Logger::Warning << "Asked to run with 0 tcpthreads, raising to 1 instead" << endl,
-         log->info(Logr::Warning, "Asked to run with 0 tcpthreads, raising to 1 instead"));
+    SLOG(g_log << Logger::Warning << "Asked to run with 0 TCP threads, raising to 1 instead" << endl,
+         log->info(Logr::Warning, "Asked to run with 0 TCP threads, raising to 1 instead"));
     RecThreadInfo::setNumTCPWorkerThreads(1);
   }
 
index e57ea13940b1a27d016113a370cbe26eada23592..d2b8a903aaaae303b982e94eee59e4344a55490c 100644 (file)
@@ -2583,6 +2583,16 @@ Maximum number of idle outgoing TCP/DoT connections per thread, 0 means do not k
         'help' : 'Launch this number of threads',
         'doc' : '''
 Spawn this number of threads on startup.
+ ''',
+    },
+    {
+        'name' : 'tcp_threads',
+        'section' : 'recursor',
+        'type' : LType.Uint64,
+        'default' : '1',
+        'help' : 'Launch this number of threads listening for and processing TCP queries',
+        'doc' : '''
+Spawn this number of TCP processing threads on startup.
  ''',
     },
     {