diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 349ccb35acd52aa5e3ccd5882d03a596e3e064ec..f51d205c26df451a0d6db06cafb0c59fbcea2379 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -1151,7 +1151,7 @@ static void doInitGlobalConfig(void) { cfg.ptr = &tsHttpMaxThreads; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG; - cfg.minValue = 1; + cfg.minValue = 2; cfg.maxValue = 1000000; cfg.ptrLength = 0; cfg.unitType = TAOS_CFG_UTYPE_NONE; @@ -1523,6 +1523,13 @@ int32_t taosCheckGlobalCfg() { tsNumOfCores = 1; } + if (tsHttpMaxThreads == 2) { + int32_t halfNumOfCores = tsNumOfCores >> 1; + if (halfNumOfCores > 2) { + tsHttpMaxThreads = halfNumOfCores; + } + } + if (tsMaxTablePerVnode < tsMinTablePerVnode) { uError("maxTablesPerVnode(%d) < minTablesPerVnode(%d), reset to minTablesPerVnode(%d)", tsMaxTablePerVnode, tsMinTablePerVnode, tsMinTablePerVnode);