Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e4652d5a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e4652d5a
编写于
4月 07, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust thread nums
上级
5eb0b463
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
32 deletion
+47
-32
include/common/tglobal.h
include/common/tglobal.h
+5
-2
include/os/osMath.h
include/os/osMath.h
+6
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+33
-18
source/dnode/mgmt/main/dndTransport.c
source/dnode/mgmt/main/dndTransport.c
+1
-6
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+2
-6
未找到文件。
include/common/tglobal.h
浏览文件 @
e4652d5a
...
...
@@ -41,8 +41,6 @@ extern int32_t tsMaxConnections;
extern
int32_t
tsMaxShellConns
;
extern
int32_t
tsShellActivityTimer
;
extern
int32_t
tsMaxTmrCtrl
;
extern
float
tsNumOfThreadsPerCore
;
extern
int32_t
tsNumOfCommitThreads
;
extern
float
tsRatioOfQueryCores
;
extern
int32_t
tsCompressMsgSize
;
extern
int32_t
tsCompressColData
;
...
...
@@ -60,6 +58,11 @@ extern int32_t tsQnodeShmSize;
extern
int32_t
tsSnodeShmSize
;
extern
int32_t
tsBnodeShmSize
;
// queue & threads
extern
int32_t
tsNumOfRpcThreads
;
extern
int32_t
tsNumOfCommitThreads
;
extern
int32_t
tsNumOfTaskQueueThreads
;
// monitor
extern
bool
tsEnableMonitor
;
extern
int32_t
tsMonitorInterval
;
...
...
include/os/osMath.h
浏览文件 @
e4652d5a
...
...
@@ -56,6 +56,12 @@ extern "C" {
__typeof(b) __b = (b); \
(__a < __b) ? __a : __b; \
})
#define TRANGE(a, b, c) \
({ \
a = TMAX(a, b); \
a = TMIN(a, c); \
})
#endif
#ifdef __cplusplus
...
...
source/common/src/tglobal.c
浏览文件 @
e4652d5a
...
...
@@ -30,21 +30,19 @@ char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port
uint16_t
tsServerPort
=
6030
;
int32_t
tsVersion
=
30000000
;
int32_t
tsStatusInterval
=
1
;
// second
bool
tsEnableTelemetryReporting
=
0
;
bool
tsEnableTelemetryReporting
=
false
;
// common
int32_t
tsRpcTimer
=
300
;
int32_t
tsRpcMaxTime
=
600
;
// seconds;
bool
tsRpcForceTcp
=
1
;
// disable this, means query, show command use udp protocol as default
int32_t
tsRpcMaxTime
=
600
;
// seconds;
bool
tsRpcForceTcp
=
true
;
// disable this, means query, show command use udp protocol as default
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsMaxConnections
=
50000
;
int32_t
tsShellActivityTimer
=
3
;
// second
float
tsNumOfThreadsPerCore
=
1
.
0
f
;
int32_t
tsNumOfCommitThreads
=
4
;
float
tsRatioOfQueryCores
=
1
.
0
f
;
int32_t
tsMaxBinaryDisplayWidth
=
30
;
bool
tsEnableSlaveQuery
=
1
;
bool
tsPrintAuth
=
0
;
bool
tsEnableSlaveQuery
=
true
;
bool
tsPrintAuth
=
false
;
// multi process
bool
tsMultiProcess
=
false
;
...
...
@@ -54,8 +52,13 @@ int32_t tsQnodeShmSize = TSDB_MAX_WAL_SIZE * 4;
int32_t
tsSnodeShmSize
=
TSDB_MAX_WAL_SIZE
*
4
;
int32_t
tsBnodeShmSize
=
TSDB_MAX_WAL_SIZE
*
4
;
// queue & threads
int32_t
tsNumOfRpcThreads
=
1
;
int32_t
tsNumOfCommitThreads
=
2
;
int32_t
tsNumOfTaskQueueThreads
=
1
;
// monitor
bool
tsEnableMonitor
=
1
;
bool
tsEnableMonitor
=
true
;
int32_t
tsMonitorInterval
=
30
;
char
tsMonitorFqdn
[
TSDB_FQDN_LEN
]
=
{
0
};
uint16_t
tsMonitorPort
=
6043
;
...
...
@@ -124,13 +127,13 @@ int32_t tsQueryBufferSize = -1;
int64_t
tsQueryBufferSizeBytes
=
-
1
;
// in retrieve blocking model, the retrieve threads will wait for the completion of the query processing.
bool
tsRetrieveBlockingModel
=
0
;
bool
tsRetrieveBlockingModel
=
false
;
// last_row(*), first(*), last_row(ts, col1, col2) query, the result fields will be the original column name
bool
tsKeepOriginalColumnName
=
0
;
bool
tsKeepOriginalColumnName
=
false
;
// kill long query
bool
tsDeadLockKillQuery
=
0
;
bool
tsDeadLockKillQuery
=
false
;
// tsdb config
// For backward compatibility
...
...
@@ -290,7 +293,6 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"serverPort"
,
defaultServerPort
,
1
,
65056
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"tempDir"
,
tsTempDir
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalTempDirGB"
,
1
.
0
f
,
0
.
001
f
,
10000000
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"numOfThreadsPerCore"
,
tsNumOfThreadsPerCore
,
0
,
10
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxTmrCtrl"
,
tsMaxTmrCtrl
,
8
,
2048
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"rpcTimer"
,
tsRpcTimer
,
100
,
3000
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"rpcMaxTime"
,
tsRpcMaxTime
,
100
,
7200
,
1
)
!=
0
)
return
-
1
;
...
...
@@ -304,6 +306,11 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"keepColumnName"
,
tsKeepOriginalColumnName
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxBinaryDisplayWidth"
,
tsMaxBinaryDisplayWidth
,
1
,
65536
,
1
)
!=
0
)
return
-
1
;
tsNumOfTaskQueueThreads
=
tsNumOfCores
/
4
;
tsNumOfTaskQueueThreads
=
TRANGE
(
tsNumOfTaskQueueThreads
,
1
,
2
);
if
(
cfgAddInt32
(
pCfg
,
"numOfTaskQueueThreads"
,
tsNumOfTaskQueueThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
return
0
;
}
...
...
@@ -336,7 +343,6 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"supportVnodes"
,
256
,
0
,
65536
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalDataDirGB"
,
2
.
0
f
,
0
.
001
f
,
10000000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"numOfCommitThreads"
,
tsNumOfCommitThreads
,
1
,
100
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"ratioOfQueryCores"
,
tsRatioOfQueryCores
,
0
,
2
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxNumOfDistinctRes"
,
tsMaxNumOfDistinctResults
,
10
*
10000
,
10000
*
10000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"telemetryReporting"
,
tsEnableTelemetryReporting
,
0
)
!=
0
)
return
-
1
;
...
...
@@ -360,7 +366,15 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"vnodeShmSize"
,
tsVnodeShmSize
,
4096
,
INT32_MAX
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"qnodeShmSize"
,
tsQnodeShmSize
,
4096
,
INT32_MAX
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"snodeShmSize"
,
tsSnodeShmSize
,
4096
,
INT32_MAX
,
0
)
!=
0
)
return
-
1
;
// if (cfgAddInt32(pCfg, "bnodeShmSize", tsBnodeShmSize, 4096, INT32_MAX, 0) != 0) return -1;
if
(
cfgAddInt32
(
pCfg
,
"bnodeShmSize"
,
tsBnodeShmSize
,
4096
,
INT32_MAX
,
0
)
!=
0
)
return
-
1
;
tsNumOfRpcThreads
=
tsNumOfCores
/
2
;
tsNumOfRpcThreads
=
TRANGE
(
tsNumOfRpcThreads
,
1
,
4
);
if
(
cfgAddInt32
(
pCfg
,
"numOfRpcThreads"
,
tsNumOfRpcThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
tsNumOfCommitThreads
=
tsNumOfCommitThreads
/
2
;
tsNumOfCommitThreads
=
TRANGE
(
tsNumOfCommitThreads
,
2
,
4
);
if
(
cfgAddInt32
(
pCfg
,
"numOfCommitThreads"
,
tsNumOfCommitThreads
,
1
,
100
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"monitor"
,
tsEnableMonitor
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"monitorInterval"
,
tsMonitorInterval
,
1
,
360000
,
0
)
!=
0
)
return
-
1
;
...
...
@@ -424,7 +438,6 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
return
-
1
;
}
tsNumOfThreadsPerCore
=
cfgGetItem
(
pCfg
,
"numOfThreadsPerCore"
)
->
fval
;
tsMaxTmrCtrl
=
cfgGetItem
(
pCfg
,
"maxTmrCtrl"
)
->
i32
;
tsRpcTimer
=
cfgGetItem
(
pCfg
,
"rpcTimer"
)
->
i32
;
tsRpcMaxTime
=
cfgGetItem
(
pCfg
,
"rpcMaxTime"
)
->
i32
;
...
...
@@ -437,7 +450,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
tsMaxNumOfOrderedResults
=
cfgGetItem
(
pCfg
,
"maxNumOfOrderedRes"
)
->
i32
;
tsKeepOriginalColumnName
=
cfgGetItem
(
pCfg
,
"keepColumnName"
)
->
bval
;
tsMaxBinaryDisplayWidth
=
cfgGetItem
(
pCfg
,
"maxBinaryDisplayWidth"
)
->
i32
;
tsNumOfTaskQueueThreads
=
cfgGetItem
(
pCfg
,
"numOfTaskQueueThreads"
)
->
i32
;
return
0
;
}
...
...
@@ -461,7 +474,6 @@ static void taosSetSystemCfg(SConfig *pCfg) {
static
int32_t
taosSetServerCfg
(
SConfig
*
pCfg
)
{
tsDataSpace
.
reserved
=
cfgGetItem
(
pCfg
,
"minimalDataDirGB"
)
->
fval
;
tsNumOfCommitThreads
=
cfgGetItem
(
pCfg
,
"numOfCommitThreads"
)
->
i32
;
tsRatioOfQueryCores
=
cfgGetItem
(
pCfg
,
"ratioOfQueryCores"
)
->
fval
;
tsMaxNumOfDistinctResults
=
cfgGetItem
(
pCfg
,
"maxNumOfDistinctRes"
)
->
i32
;
tsEnableTelemetryReporting
=
cfgGetItem
(
pCfg
,
"telemetryReporting"
)
->
bval
;
...
...
@@ -485,7 +497,10 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsVnodeShmSize
=
cfgGetItem
(
pCfg
,
"vnodeShmSize"
)
->
i32
;
tsQnodeShmSize
=
cfgGetItem
(
pCfg
,
"qnodeShmSize"
)
->
i32
;
tsSnodeShmSize
=
cfgGetItem
(
pCfg
,
"snodeShmSize"
)
->
i32
;
// tsBnodeShmSize = cfgGetItem(pCfg, "bnodeShmSize")->i32;
tsBnodeShmSize
=
cfgGetItem
(
pCfg
,
"bnodeShmSize"
)
->
i32
;
tsNumOfRpcThreads
=
cfgGetItem
(
pCfg
,
"numOfRpcThreads"
)
->
i32
;
tsNumOfCommitThreads
=
cfgGetItem
(
pCfg
,
"numOfCommitThreads"
)
->
i32
;
tsEnableMonitor
=
cfgGetItem
(
pCfg
,
"monitor"
)
->
bval
;
tsMonitorInterval
=
cfgGetItem
(
pCfg
,
"monitorInterval"
)
->
i32
;
...
...
source/dnode/mgmt/main/dndTransport.c
浏览文件 @
e4652d5a
...
...
@@ -257,16 +257,11 @@ static int32_t dndRetrieveUserAuthInfo(SDnode *pDnode, char *user, char *spi, ch
static
int32_t
dndInitServer
(
SDnode
*
pDnode
)
{
STransMgmt
*
pMgmt
=
&
pDnode
->
trans
;
int32_t
numOfThreads
=
(
int32_t
)((
tsNumOfCores
*
tsNumOfThreadsPerCore
)
/
2
.
0
);
if
(
numOfThreads
<
1
)
{
numOfThreads
=
1
;
}
SRpcInit
rpcInit
;
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
rpcInit
.
localPort
=
pDnode
->
serverPort
;
rpcInit
.
label
=
"DND"
;
rpcInit
.
numOfThreads
=
numOf
Threads
;
rpcInit
.
numOfThreads
=
tsNumOfRpc
Threads
;
rpcInit
.
cfp
=
(
RpcCfp
)
dndProcessMsg
;
rpcInit
.
sessions
=
tsMaxShellConns
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
e4652d5a
...
...
@@ -97,18 +97,14 @@ bool tIsValidSchema(struct SSchema* pSchema, int32_t numOfCols, int32_t numOfTag
static
void
*
pTaskQueue
=
NULL
;
int32_t
initTaskQueue
()
{
double
factor
=
4
.
0
;
int32_t
numOfThreads
=
TMAX
((
int
)(
tsNumOfCores
*
tsNumOfThreadsPerCore
/
factor
),
2
);
int32_t
queueSize
=
tsMaxConnections
*
2
;
pTaskQueue
=
taosInitScheduler
(
queueSize
,
numOf
Threads
,
"tsc"
);
pTaskQueue
=
taosInitScheduler
(
queueSize
,
tsNumOfTaskQueue
Threads
,
"tsc"
);
if
(
NULL
==
pTaskQueue
)
{
qError
(
"failed to init task queue"
);
return
-
1
;
}
qDebug
(
"task queue is initialized, numOfThreads: %d"
,
numOf
Threads
);
qDebug
(
"task queue is initialized, numOfThreads: %d"
,
tsNumOfTaskQueue
Threads
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录