HTTP读取L2节点时增加最大连接数、最大空闲连接数、最大空闲时间

This commit is contained in:
刘祥超
2022-08-03 20:54:08 +08:00
parent ceadcfece9
commit 3f24bfaaf5

View File

@@ -54,6 +54,7 @@ func (this *HTTPClientPool) Client(req *HTTPRequest,
}
var key = origin.UniqueKey() + "@" + originAddr
var isLnRequest = origin.Id == 0
this.locker.RLock()
client, found := this.clientsMap[key]
@@ -101,6 +102,13 @@ func (this *HTTPClientPool) Client(req *HTTPRequest,
idleConns = numberCPU * 8
}
// 可以判断为Ln节点请求
if isLnRequest {
maxConnections *= 8
idleConns *= 8
idleTimeout *= 4
}
// TLS通讯
var tlsConfig = &tls.Config{
InsecureSkipVerify: true,