feat: 修改http连接池大小为32
parent
9893afc5c7
commit
ee1df265a8
|
|
@ -72,11 +72,11 @@ public class ConnPool {
|
|||
|
||||
public ConnPool build() {
|
||||
if (Objects.isNull(this.maxRequests) || this.maxRequests <= 0) {
|
||||
this.maxRequests = 64;
|
||||
this.maxRequests = 32;
|
||||
}
|
||||
|
||||
if (Objects.isNull(this.maxRequestPerHost) || this.maxRequestPerHost <= 0) {
|
||||
this.maxRequestPerHost = 64;
|
||||
this.maxRequestPerHost = 32;
|
||||
}
|
||||
|
||||
if (Objects.isNull(this.connectTimeout) || this.connectTimeout <= 0) {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class ApiClientBuilderTest {
|
|||
Assertions.assertNotNull(profile.getSignature());
|
||||
assertThatJson("{\"appNo\":\"111111\",\"channelNo\":\"000000\",\"channelGroupMode\":false}").isEqualTo(profile.getChannel());
|
||||
assertThatJson("{\"host\":\"http://127.0.0.1:8888\"," +
|
||||
"\"connPool\":{\"maxRequests\":64,\"maxRequestPerHost\":64,\"connectTimeout\":10,\"socketTimeout\":60}," +
|
||||
"\"connPool\":{\"maxRequests\":32,\"maxRequestPerHost\":32,\"connectTimeout\":10,\"socketTimeout\":60}," +
|
||||
"\"headers\":{}," +
|
||||
"\"proxy\":{\"enabled\":false,\"host\":null,\"port\":null,\"username\":\"\",\"password\":\"\",\"scheme\":\"http\"}}\n")
|
||||
.isEqualTo(profile.getHttpProfile());
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ class ConnPoolTest {
|
|||
void test() {
|
||||
ConnPool pool = new ConnPool.Builder().build();
|
||||
Assertions.assertEquals(10, pool.getConnectTimeout());
|
||||
Assertions.assertEquals(64, pool.getMaxRequests());
|
||||
Assertions.assertEquals(64, pool.getMaxRequestPerHost());
|
||||
Assertions.assertEquals(32, pool.getMaxRequests());
|
||||
Assertions.assertEquals(32, pool.getMaxRequestPerHost());
|
||||
Assertions.assertEquals(60, pool.getSocketTimeout());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,11 +145,11 @@ public class ScfsApiGatewayProperties {
|
|||
/**
|
||||
* 最大连接数
|
||||
*/
|
||||
private Integer maxRequests = 64;
|
||||
private Integer maxRequests = 32;
|
||||
/**
|
||||
* 每个路由最大连接数
|
||||
*/
|
||||
private Integer maxRequestPerHost = 64;
|
||||
private Integer maxRequestPerHost = 32;
|
||||
/**
|
||||
* http 连接超时时间 默认10秒
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue