feat: 修改http连接池大小为32

main
13009 2024-09-24 11:18:12 +08:00
parent 9893afc5c7
commit ee1df265a8
4 changed files with 7 additions and 7 deletions

View File

@ -72,11 +72,11 @@ public class ConnPool {
public ConnPool build() { public ConnPool build() {
if (Objects.isNull(this.maxRequests) || this.maxRequests <= 0) { if (Objects.isNull(this.maxRequests) || this.maxRequests <= 0) {
this.maxRequests = 64; this.maxRequests = 32;
} }
if (Objects.isNull(this.maxRequestPerHost) || this.maxRequestPerHost <= 0) { if (Objects.isNull(this.maxRequestPerHost) || this.maxRequestPerHost <= 0) {
this.maxRequestPerHost = 64; this.maxRequestPerHost = 32;
} }
if (Objects.isNull(this.connectTimeout) || this.connectTimeout <= 0) { if (Objects.isNull(this.connectTimeout) || this.connectTimeout <= 0) {

View File

@ -63,7 +63,7 @@ class ApiClientBuilderTest {
Assertions.assertNotNull(profile.getSignature()); Assertions.assertNotNull(profile.getSignature());
assertThatJson("{\"appNo\":\"111111\",\"channelNo\":\"000000\",\"channelGroupMode\":false}").isEqualTo(profile.getChannel()); assertThatJson("{\"appNo\":\"111111\",\"channelNo\":\"000000\",\"channelGroupMode\":false}").isEqualTo(profile.getChannel());
assertThatJson("{\"host\":\"http://127.0.0.1:8888\"," + 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\":{}," + "\"headers\":{}," +
"\"proxy\":{\"enabled\":false,\"host\":null,\"port\":null,\"username\":\"\",\"password\":\"\",\"scheme\":\"http\"}}\n") "\"proxy\":{\"enabled\":false,\"host\":null,\"port\":null,\"username\":\"\",\"password\":\"\",\"scheme\":\"http\"}}\n")
.isEqualTo(profile.getHttpProfile()); .isEqualTo(profile.getHttpProfile());

View File

@ -8,8 +8,8 @@ class ConnPoolTest {
void test() { void test() {
ConnPool pool = new ConnPool.Builder().build(); ConnPool pool = new ConnPool.Builder().build();
Assertions.assertEquals(10, pool.getConnectTimeout()); Assertions.assertEquals(10, pool.getConnectTimeout());
Assertions.assertEquals(64, pool.getMaxRequests()); Assertions.assertEquals(32, pool.getMaxRequests());
Assertions.assertEquals(64, pool.getMaxRequestPerHost()); Assertions.assertEquals(32, pool.getMaxRequestPerHost());
Assertions.assertEquals(60, pool.getSocketTimeout()); Assertions.assertEquals(60, pool.getSocketTimeout());
} }

View File

@ -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 * http 10
*/ */