Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f19fdaa1
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看板
提交
f19fdaa1
编写于
2月 17, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt trans
上级
b894ba6f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
7 deletion
+19
-7
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+3
-2
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+2
-1
source/libs/transport/inc/transportInt.h
source/libs/transport/inc/transportInt.h
+1
-0
source/libs/transport/src/trans.c
source/libs/transport/src/trans.c
+1
-0
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+10
-3
source/libs/transport/test/cliBench.c
source/libs/transport/test/cliBench.c
+2
-1
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
f19fdaa1
...
...
@@ -115,8 +115,9 @@ typedef struct SRpcInit {
int32_t
connLimitNum
;
int32_t
connLimitLock
;
int8_t
supportBatch
;
// 0: no batch, 1. batch
void
*
parent
;
int8_t
supportBatch
;
// 0: no batch, 1. batch
int32_t
batchSize
;
void
*
parent
;
}
SRpcInit
;
typedef
struct
{
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
f19fdaa1
...
...
@@ -286,11 +286,12 @@ int32_t dmInitClient(SDnode *pDnode) {
int32_t
connLimitNum
=
10000
/
(
tsNumOfRpcThreads
*
3
);
connLimitNum
=
TMAX
(
connLimitNum
,
100
);
connLimitNum
=
TMIN
(
connLimitNum
,
6
00
);
connLimitNum
=
TMIN
(
connLimitNum
,
5
00
);
rpcInit
.
connLimitNum
=
connLimitNum
;
rpcInit
.
connLimitLock
=
1
;
rpcInit
.
supportBatch
=
1
;
rpcInit
.
batchSize
=
64
*
1024
;
pTrans
->
clientRpc
=
rpcOpen
(
&
rpcInit
);
if
(
pTrans
->
clientRpc
==
NULL
)
{
...
...
source/libs/transport/inc/transportInt.h
浏览文件 @
f19fdaa1
...
...
@@ -67,6 +67,7 @@ typedef struct {
int32_t
connLimitNum
;
int8_t
connLimitLock
;
// 0: no lock. 1. lock
int8_t
supportBatch
;
// 0: no batch, 1: support batch
int32_t
batchSize
;
int
index
;
void
*
parent
;
...
...
source/libs/transport/src/trans.c
浏览文件 @
f19fdaa1
...
...
@@ -70,6 +70,7 @@ void* rpcOpen(const SRpcInit* pInit) {
pRpc
->
connLimitNum
=
pInit
->
connLimitNum
;
pRpc
->
connLimitLock
=
pInit
->
connLimitLock
;
pRpc
->
supportBatch
=
pInit
->
supportBatch
;
pRpc
->
batchSize
=
pInit
->
batchSize
;
pRpc
->
numOfThreads
=
pInit
->
numOfThreads
>
TSDB_MAX_RPC_THREADS
?
TSDB_MAX_RPC_THREADS
:
pInit
->
numOfThreads
;
if
(
pRpc
->
numOfThreads
<=
0
)
{
...
...
source/libs/transport/src/transCli.c
浏览文件 @
f19fdaa1
...
...
@@ -27,6 +27,7 @@ typedef struct {
int
connMax
;
int
connCnt
;
int
batchLenLimit
;
int
sending
;
char
*
dst
;
char
*
ip
;
...
...
@@ -992,6 +993,8 @@ static void cliDestroyBatch(SCliBatch* pBatch) {
SCliMsg
*
p
=
QUEUE_DATA
(
h
,
SCliMsg
,
q
);
destroyCmsg
(
p
);
}
SCliBatchList
*
p
=
pBatch
->
pList
;
p
->
sending
-=
1
;
taosMemoryFree
(
pBatch
);
}
static
void
cliHandleBatchReq
(
SCliBatch
*
pBatch
,
SCliThrd
*
pThrd
)
{
...
...
@@ -1461,11 +1464,12 @@ static void cliNoBatchDealReq(queue* wq, SCliThrd* pThrd) {
}
}
SCliBatch
*
cliGetHeadFromList
(
SCliBatchList
*
pList
)
{
if
(
QUEUE_IS_EMPTY
(
&
pList
->
wq
)
||
pList
->
connCnt
>
=
pList
->
connMax
)
{
if
(
QUEUE_IS_EMPTY
(
&
pList
->
wq
)
||
pList
->
connCnt
>
pList
->
connMax
||
pList
->
sending
>
pList
->
connMax
)
{
return
NULL
;
}
queue
*
hr
=
QUEUE_HEAD
(
&
pList
->
wq
);
QUEUE_REMOVE
(
hr
);
pList
->
sending
+=
1
;
pList
->
len
-=
1
;
...
...
@@ -1474,6 +1478,8 @@ SCliBatch* cliGetHeadFromList(SCliBatchList* pList) {
}
static
void
cliBatchDealReq
(
queue
*
wq
,
SCliThrd
*
pThrd
)
{
STrans
*
pInst
=
pThrd
->
pTransInst
;
int
count
=
0
;
while
(
!
QUEUE_IS_EMPTY
(
wq
))
{
queue
*
h
=
QUEUE_HEAD
(
wq
);
...
...
@@ -1493,9 +1499,10 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) {
if
(
ppBatchList
==
NULL
||
*
ppBatchList
==
NULL
)
{
SCliBatchList
*
pBatchList
=
taosMemoryCalloc
(
1
,
sizeof
(
SCliBatchList
));
QUEUE_INIT
(
&
pBatchList
->
wq
);
pBatchList
->
connMax
=
200
;
pBatchList
->
connMax
=
pInst
->
connLimitNum
;
pBatchList
->
connCnt
=
0
;
pBatchList
->
batchLenLimit
=
16
*
1024
;
pBatchList
->
batchLenLimit
=
pInst
->
batchSize
;
pBatchList
->
ip
=
strdup
(
ip
);
pBatchList
->
dst
=
strdup
(
key
);
pBatchList
->
port
=
port
;
...
...
source/libs/transport/test/cliBench.c
浏览文件 @
f19fdaa1
...
...
@@ -114,8 +114,9 @@ int main(int argc, char *argv[]) {
rpcInit
.
user
=
"michael"
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
connLimitNum
=
30
0
;
rpcInit
.
connLimitNum
=
1
0
;
rpcInit
.
connLimitLock
=
1
;
rpcInit
.
batchSize
=
16
*
1024
;
rpcInit
.
supportBatch
=
1
;
rpcDebugFlag
=
135
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录