线程池调整.

This commit is contained in:
aoshiguchen
2023-03-15 12:01:49 +08:00
parent 69e5fb10d8
commit 7fd6fd5313
6 changed files with 11 additions and 5 deletions
@@ -42,6 +42,8 @@ public class ProxyConfig {
private String keyStorePassword;
private String keyManagerPassword;
private String jksPath;
private Integer bossThreadCount;
private Integer workThreadCount;
}
}
@@ -35,13 +35,13 @@ public class ProxyConfiguration implements LifecycleBean {
}
@Bean("serverBossGroup")
public NioEventLoopGroup serverBossGroup() {
return new NioEventLoopGroup();
public NioEventLoopGroup serverBossGroup(@Inject ProxyConfig proxyConfig) {
return new NioEventLoopGroup(proxyConfig.getServer().getBossThreadCount());
}
@Bean("serverWorkerGroup")
public NioEventLoopGroup serverWorkerGroup() {
return new NioEventLoopGroup();
public NioEventLoopGroup serverWorkerGroup(@Inject ProxyConfig proxyConfig) {
return new NioEventLoopGroup(proxyConfig.getServer().getWorkThreadCount());
}
}
@@ -13,6 +13,8 @@ neutrino:
write-idle-time: 10
all-idle-time-seconds: 0
server:
boss-thread-count: 10
work-thread-count: 60
port: 9000
ssl-port: 9002
key-store-password: 123456