提交 05d2260d 编写于 作者: H Haojun Liao

[td-225] add tcp transfer threshold

上级 74ddf041
...@@ -122,6 +122,8 @@ extern int tsBalancePolicy; ...@@ -122,6 +122,8 @@ extern int tsBalancePolicy;
extern int tsOfflineThreshold; extern int tsOfflineThreshold;
extern int tsMgmtEqualVnodeNum; extern int tsMgmtEqualVnodeNum;
extern int tsTCPTransferThreshold;
extern int tsEnableHttpModule; extern int tsEnableHttpModule;
extern int tsEnableMonitorModule; extern int tsEnableMonitorModule;
extern int tsRestRowLimit; extern int tsRestRowLimit;
......
...@@ -756,7 +756,8 @@ int taosSendUdpData(uint32_t ip, uint16_t port, char *data, int dataLen, void *c ...@@ -756,7 +756,8 @@ int taosSendUdpData(uint32_t ip, uint16_t port, char *data, int dataLen, void *c
if (pConn == NULL || pConn->signature != pConn) return -1; if (pConn == NULL || pConn->signature != pConn) return -1;
if (dataLen >= RPC_MAX_UDP_SIZE) return taosSendPacketViaTcp(ip, port, data, dataLen, chandle); assert(tsTCPTransferThreshold <= RPC_MAX_UDP_SIZE && tsTCPTransferThreshold > 0);
if (dataLen >= tsTCPTransferThreshold) return taosSendPacketViaTcp(ip, port, data, dataLen, chandle);
if (pConn->hash == NULL) { if (pConn->hash == NULL) {
struct sockaddr_in destAdd; struct sockaddr_in destAdd;
......
...@@ -130,6 +130,8 @@ int tsBalancePolicy = 0; // 1-use sys.montor ...@@ -130,6 +130,8 @@ int tsBalancePolicy = 0; // 1-use sys.montor
int tsOfflineThreshold = 864000; // seconds 10days int tsOfflineThreshold = 864000; // seconds 10days
int tsMgmtEqualVnodeNum = 4; int tsMgmtEqualVnodeNum = 4;
int tsTCPTransferThreshold = 65480; // RPC_MAX_UDP_SIZE
int tsEnableHttpModule = 1; int tsEnableHttpModule = 1;
int tsEnableMonitorModule = 1; int tsEnableMonitorModule = 1;
int tsRestRowLimit = 10240; int tsRestRowLimit = 10240;
...@@ -710,6 +712,10 @@ static void doInitGlobalConfig() { ...@@ -710,6 +712,10 @@ static void doInitGlobalConfig() {
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT,
0, 0, tListLen(tsCharset), TSDB_CFG_UTYPE_NONE); 0, 0, tListLen(tsCharset), TSDB_CFG_UTYPE_NONE);
tsInitConfigOption(cfg++, "tcptransferThreshold", &tsTCPTransferThreshold, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW,
500, 65480, 0, TSDB_CFG_UTYPE_BYTE);
// connect configs // connect configs
tsInitConfigOption(cfg++, "maxShellConns", &tsMaxShellConns, TSDB_CFG_VTYPE_INT, tsInitConfigOption(cfg++, "maxShellConns", &tsMaxShellConns, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册