From ce825c8b89117a0f6afe8b43def96cb48856781d Mon Sep 17 00:00:00 2001 From: zhihaop Date: Wed, 26 Oct 2022 09:09:11 +0000 Subject: [PATCH] feat: batch write is not enabled by default --- packaging/cfg/taos.cfg | 12 ++++++------ src/client/src/tscAsync.c | 2 +- src/common/src/tglobal.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packaging/cfg/taos.cfg b/packaging/cfg/taos.cfg index b547905008..8ec23757d1 100644 --- a/packaging/cfg/taos.cfg +++ b/packaging/cfg/taos.cfg @@ -311,11 +311,11 @@ keepColumnName 1 # unit Hour. Latency of data migration # keepTimeOffset 0 -# enable thread local write batching. -# writeBatchThreadLocal 0 +# taosc write batch size, maximum 4096, suggested value 64 ~ 512, default 0, 0 means disable write batching. +# writeBatchSize 0 -# taosc write batch size, maximum 4096, 0 means disabled write batching. suggesting value: 64 ~ 512. -# writeBatchSize 96 +# taosc write batch timeout in milliseconds, maximum 2048, suggested value 2 ~ 100, default 10. +# writeBatchTimeout 10 -# taosc write batch timeout in milliseconds, maximum 2048. suggesting value: 2 ~ 100. -# writeBatchTimeout 10 \ No newline at end of file +# using thread local write batching. this option is not available when writeBatchSize = 0.::: +# writeBatchThreadLocal 0 \ No newline at end of file diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 232de38f9f..a61859dd59 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -411,7 +411,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, __async_cb_func_t fp, void* para // TODO return the correct error code to client in tscQueueAsyncError void taos_query_a(TAOS *taos, const char *sqlstr, __async_cb_func_t fp, void *param) { - taos_query_ra(taos, sqlstr, fp, param, true); + taos_query_ra(taos, sqlstr, fp, param, tsWriteBatchSize > 0); } TAOS_RES * taos_query_ra(TAOS *taos, const char *sqlstr, __async_cb_func_t fp, void *param, bool enableBatch) { diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 7dbca7977c..5ae4b97d79 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -129,7 +129,7 @@ int64_t tsMaxRetentWindow = 24 * 3600L; // maximum time window tolerance // The tsc async write batching feature (using ABWD). bool tsWriteBatchThreadLocal = false; // if thread local enable, each thread will allocate a dispatcher. -int32_t tsWriteBatchSize = 96; // suggest: 64 - 512, 0 means disable batching. +int32_t tsWriteBatchSize = 0; // suggest: 64 - 512, default 0, 0 means disable batching. int32_t tsWriteBatchTimeout = 10; // suggest: 2 - 100 (unit: milliseconds) // the maximum allowed query buffer size during query processing for each data node. -- GitLab