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``
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``
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);
}
'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.
''',
},
{