[TD-2008]<fix>: min(tsHttpMaxThreads) <- 2, default(tsHttpMaxThreads) <- half of tsNumOfCores

This commit is contained in:
Minglei Jin 2021-02-26 16:49:29 +08:00
parent 9bb3c47067
commit 7fc819d5c6
1 changed files with 8 additions and 1 deletions

View File

@ -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);