From 02f97ece3262da6878a1e28137927059e1738a7c Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Wed, 15 Jul 2020 14:37:32 +0800 Subject: [PATCH] adjust some parameter for efficiency --- src/inc/taosdef.h | 2 +- src/tsdb/src/tsdbMemTable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 7696c91bdf..db0333a7c5 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -293,7 +293,7 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_MIN_TOTAL_BLOCKS 2 #define TSDB_MAX_TOTAL_BLOCKS 10000 -#define TSDB_DEFAULT_TOTAL_BLOCKS 4 +#define TSDB_DEFAULT_TOTAL_BLOCKS 6 #define TSDB_MIN_TABLES 4 #define TSDB_MAX_TABLES 10000000 diff --git a/src/tsdb/src/tsdbMemTable.c b/src/tsdb/src/tsdbMemTable.c index 1cd212b216..a51a172896 100644 --- a/src/tsdb/src/tsdbMemTable.c +++ b/src/tsdb/src/tsdbMemTable.c @@ -172,7 +172,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) { STsdbBufBlock *pBufBlock = tsdbGetCurrBufBlock(pRepo); if (pBufBlock != NULL && pBufBlock->remain < bytes) { - if (listNEles(pRepo->mem->bufBlockList) >= pCfg->totalBlocks / 2) { // need to commit mem + if (listNEles(pRepo->mem->bufBlockList) >= pCfg->totalBlocks / 3) { // need to commit mem if (tsdbAsyncCommit(pRepo) < 0) return NULL; } else { if (tsdbLockRepo(pRepo) < 0) return NULL; -- GitLab