unsigned int RecThreadInfo::s_numDistributorThreads;
unsigned int RecThreadInfo::s_numUDPWorkerThreads;
unsigned int RecThreadInfo::s_numTCPWorkerThreads;
+unsigned int RecThreadInfo::s_numTaskThreads;
thread_local unsigned int RecThreadInfo::t_id{RecThreadInfo::TID_NOT_INITED};
pdns::RateLimitedLog g_rateLimitedLogger;
RecThreadInfo::setNumDistributorThreads(::arg().asNum("distributor-threads"));
RecThreadInfo::setNumUDPWorkerThreads(::arg().asNum("threads"));
+ RecThreadInfo::setNumTaskThreads(::arg().asNum("taskthreads"));
if (RecThreadInfo::numUDPWorkers() < 1) {
log->info(Logr::Warning, "Asked to run with 0 threads, raising to 1 instead");
RecThreadInfo::setNumUDPWorkerThreads(1);
static unsigned int numTaskThreads()
{
- return 1;
+ return s_numTaskThreads;
}
static unsigned int numUDPWorkers()
s_numDistributorThreads = n;
}
+ static void setNumTaskThreads(unsigned int n)
+ {
+ s_numTaskThreads = n;
+ }
+
static unsigned int numRecursorThreads()
{
return numHandlers() + numDistributors() + numUDPWorkers() + numTCPWorkers() + numTaskThreads();
static unsigned int s_numDistributorThreads;
static unsigned int s_numUDPWorkerThreads;
static unsigned int s_numTCPWorkerThreads;
+ static unsigned int s_numTaskThreads;
};
struct ThreadMSG
"section": "recursor",
"type": LType.Uint64,
"default": "2",
- "help": "Launch this number of threads",
+ "help": "Launch this number of worker threads",
"doc": """
-Spawn this number of threads on startup.
+Spawn this number of worker threads on startup.
""",
},
{
""",
"versionadded": "5.0.0",
},
+ {
+ "name": "taskthreads",
+ "section": "recursor",
+ "type": LType.Uint64,
+ "default": "1",
+ "help": "Launch this number of async task threads",
+ "doc": """
+Spawn this number of asynchronous task threads on startup.
+ """,
+ "versionadded": "5.5.0",
+ },
{
"name": "trace",
"section": "logging",