diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 1ddab769d83fa586a47d2843c6f7a45ee8a21946..f35352268f864f3c1a2c138b954e5e6513e9d9cc 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -284,9 +284,9 @@ int32_t dmInitClient(SDnode *pDnode) { rpcInit.failFastThreshold = 3; // failed threshold rpcInit.ffp = dmFailFastFp; - int32_t connLimitNum = 30000 / (tsNumOfRpcThreads * 3); - connLimitNum = TMAX(connLimitNum, 500); - connLimitNum = TMIN(connLimitNum, 1000); + int32_t connLimitNum = 10000 / (tsNumOfRpcThreads * 3); + connLimitNum = TMAX(connLimitNum, 100); + connLimitNum = TMIN(connLimitNum, 600); rpcInit.connLimitNum = connLimitNum; rpcInit.connLimitLock = 1; diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 473467d753df523fee458460cd95c77134f8b0ab..e4fa91170d9e02ebaa62c7549458b18c07a85b62 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -1070,22 +1070,24 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) { cliSendBatch(conn); } static void cliSendBatchCb(uv_write_t* req, int status) { - SCliConn* conn = req->data; - taosMemoryFree(req); + SCliConn* conn = req->data; + SCliThrd* thrd = conn->hostThrd; + SCliBatch* p = conn->pBatch; - SCliThrd* thrd = conn->hostThrd; - cliDestroyBatch(conn->pBatch); conn->pBatch = NULL; if (status != 0) { tDebug("%p conn %p failed to send batch msg, batch size:%d, msgLen:%d, reason:%s", CONN_GET_INST_LABEL(conn), conn, - conn->pBatch->wLen, conn->pBatch->batchSize, uv_err_name(status)); + p->wLen, p->batchSize, uv_err_name(status)); cliHandleExcept(conn); } else { - tDebug("%p conn %p succ to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(conn), conn, - conn->pBatch->wLen, conn->pBatch->batchSize); + tDebug("%p conn %p succ to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(conn), conn, p->wLen, + p->batchSize); addConnToPool(thrd->pool, conn); } + + cliDestroyBatch(p); + taosMemoryFree(req); } static void cliHandleFastFail(SCliConn* pConn, int status) { SCliThrd* pThrd = pConn->hostThrd;