Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
6733029e
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6733029e
编写于
12月 11, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2375]<enhance>: configure the number of CPU cores available for query processing.
上级
5721bd12
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
20 deletion
+23
-20
packaging/cfg/taos.cfg
packaging/cfg/taos.cfg
+7
-4
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+2
-2
src/common/src/tglobal.c
src/common/src/tglobal.c
+5
-5
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+1
-2
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+5
-4
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+1
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+2
-2
未找到文件。
packaging/cfg/taos.cfg
浏览文件 @
6733029e
...
...
@@ -29,8 +29,11 @@
# number of threads per CPU core
# numOfThreadsPerCore 1.0
# the proportion of total threads responsible for query
# ratioOfQueryThreads 0.5
# the proportion of total CPU cores available for query processing
# 1.0: all CPU cores are available for query processing
# 0.5: only half of the CPU cores are available for query
# 0.0: only one core available
# ratioOfQueryThreads 1.0
# number of management nodes in the system
# numOfMnodes 3
...
...
@@ -265,5 +268,5 @@
# enable/disable stream (continuous query)
# stream 1
#
only 50% CPU resources will be used in query processing
#
halfCoresForQuery
0
#
in retrieve blocking model, only in 50% query threads will be used in query processing in dnode
#
retrieveBlockModel
0
src/common/inc/tglobal.h
浏览文件 @
6733029e
...
...
@@ -46,7 +46,7 @@ extern int32_t tsShellActivityTimer;
extern
uint32_t
tsMaxTmrCtrl
;
extern
float
tsNumOfThreadsPerCore
;
extern
int32_t
tsNumOfCommitThreads
;
extern
float
tsRatioOfQueryThreads
;
// todo remove it
extern
float
tsRatioOfQueryThreads
;
extern
int8_t
tsDaylight
;
extern
char
tsTimezone
[];
extern
char
tsLocale
[];
...
...
@@ -57,7 +57,7 @@ extern char tsTempDir[];
//query buffer management
extern
int32_t
tsQueryBufferSize
;
// maximum allowed usage buffer for each data node during query processing
extern
int32_t
ts
HalfCoresForQuery
;
// only 50% will be used in query processing
extern
int32_t
ts
RetrieveBlockModel
;
// only 50% will be used in query processing
// client
extern
int32_t
tsTableMetaKeepTimer
;
...
...
src/common/src/tglobal.c
浏览文件 @
6733029e
...
...
@@ -52,7 +52,7 @@ int32_t tsMaxConnections = 5000;
int32_t
tsShellActivityTimer
=
3
;
// second
float
tsNumOfThreadsPerCore
=
1
.
0
f
;
int32_t
tsNumOfCommitThreads
=
1
;
float
tsRatioOfQueryThreads
=
0
.
5
f
;
float
tsRatioOfQueryThreads
=
1
.
0
f
;
int8_t
tsDaylight
=
0
;
char
tsTimezone
[
TSDB_TIMEZONE_LEN
]
=
{
0
};
char
tsLocale
[
TSDB_LOCALE_LEN
]
=
{
0
};
...
...
@@ -107,8 +107,8 @@ int64_t tsMaxRetentWindow = 24 * 3600L; // maximum time window tolerance
// positive value (in MB)
int32_t
tsQueryBufferSize
=
-
1
;
//
only 50% cpu
will be used in query processing in dnode
int32_t
ts
HalfCoresForQuery
=
0
;
//
in retrieve blocking model, only in 50% query threads
will be used in query processing in dnode
int32_t
ts
RetrieveBlockModel
=
0
;
// db parameters
int32_t
tsCacheBlockSize
=
TSDB_DEFAULT_CACHE_BLOCK_SIZE
;
...
...
@@ -887,8 +887,8 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_BYTE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"
halfCoresForQuery
"
;
cfg
.
ptr
=
&
ts
HalfCoresForQuery
;
cfg
.
option
=
"
retrieveBlockModel
"
;
cfg
.
ptr
=
&
ts
RetrieveBlockModel
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
6733029e
...
...
@@ -70,8 +70,7 @@ int32_t dnodeInitShell() {
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_NETWORK_TEST
]
=
dnodeSendStartupStep
;
int32_t
numOfThreads
=
tsNumOfCores
*
tsNumOfThreadsPerCore
;
numOfThreads
=
(
int32_t
)
((
1
.
0
-
tsRatioOfQueryThreads
)
*
numOfThreads
/
2
.
0
);
int32_t
numOfThreads
=
(
tsNumOfCores
*
tsNumOfThreadsPerCore
)
/
2
.
0
;
if
(
numOfThreads
<
1
)
{
numOfThreads
=
1
;
}
...
...
src/dnode/src/dnodeVRead.c
浏览文件 @
6733029e
...
...
@@ -26,16 +26,17 @@ static SWorkerPool tsVQueryWP;
static
SWorkerPool
tsVFetchWP
;
int32_t
dnodeInitVRead
()
{
const
int32_t
maxFetchThreads
=
4
;
tsVQueryWP
.
name
=
"vquery"
;
tsVQueryWP
.
workerFp
=
dnodeProcessReadQueue
;
tsVQueryWP
.
min
=
tsNumOfCores
;
tsVQueryWP
.
max
=
tsNumOfCores
/* * tsNumOfThreadsPerCore*/
;
// if (tsVQueryWP.max <= tsVQueryWP.min * 2) tsVQueryWP.max = 2 * tsVQueryWP.min;
tsVQueryWP
.
min
=
tsNumOfCores
*
tsRatioOfQueryThreads
;
tsVQueryWP
.
max
=
tsVQueryWP
.
min
;
if
(
tWorkerInit
(
&
tsVQueryWP
)
!=
0
)
return
-
1
;
tsVFetchWP
.
name
=
"vfetch"
;
tsVFetchWP
.
workerFp
=
dnodeProcessReadQueue
;
tsVFetchWP
.
min
=
MIN
(
4
,
tsNumOfCores
);
tsVFetchWP
.
min
=
MIN
(
maxFetchThreads
,
tsNumOfCores
);
tsVFetchWP
.
max
=
tsVFetchWP
.
min
;
if
(
tWorkerInit
(
&
tsVFetchWP
)
!=
0
)
return
-
1
;
...
...
src/query/src/qExecutor.c
浏览文件 @
6733029e
...
...
@@ -7635,7 +7635,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
int32_t
code
=
TSDB_CODE_SUCCESS
;
if
(
ts
HalfCoresForQuery
)
{
if
(
ts
RetrieveBlockModel
)
{
pQInfo
->
rspContext
=
pRspContext
;
tsem_wait
(
&
pQInfo
->
ready
);
*
buildRes
=
true
;
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
6733029e
...
...
@@ -281,7 +281,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
vDebug
(
"vgId:%d, QInfo:%p, dnode continues to exec query"
,
pVnode
->
vgId
,
*
qhandle
);
// In the retrieve blocking model, only 50% CPU will be used in query processing
if
(
ts
HalfCoresForQuery
)
{
if
(
ts
RetrieveBlockModel
)
{
qTableQuery
(
*
qhandle
);
// do execute query
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
qhandle
,
false
);
}
else
{
...
...
@@ -380,7 +380,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
freeHandle
=
true
;
}
else
{
// result is not ready, return immediately
// Only effects in the non-blocking model
if
(
!
ts
HalfCoresForQuery
)
{
if
(
!
ts
RetrieveBlockModel
)
{
if
(
!
buildRes
)
{
assert
(
pRead
->
rpcHandle
!=
NULL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录