update 优化netty配置

This commit is contained in:
Lemon
2025-07-22 03:16:32 +08:00
parent c2b30e093e
commit fe1b9b5a36

View File

@@ -54,7 +54,7 @@ public class NettyServerManager implements CommandLineRunner {
.channel(NioServerSocketChannel.class)
.handler(new LoggingHandler(LogLevel.DEBUG))
// .option(ChannelOption.SO_BACKLOG, 128) // 默认128
.option(ChannelOption.SO_BACKLOG, 2048)
.option(ChannelOption.SO_BACKLOG, 4096)
.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) // 启用池化内存分配器
// .option(ChannelOption.SO_RCVBUF, 64 * 1024)
// .option(ChannelOption.SO_REUSEADDR, true)