mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 19:29:52 +08:00
优化netty设置
This commit is contained in:
@@ -58,6 +58,7 @@ public class NettyServerManager implements CommandLineRunner {
|
|||||||
.childOption(ChannelOption.SO_SNDBUF, 64 * 1024) // 发送缓冲区
|
.childOption(ChannelOption.SO_SNDBUF, 64 * 1024) // 发送缓冲区
|
||||||
.childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, new WriteBufferWaterMark(32 * 1024, 64 * 1024)) // 写缓冲水位
|
.childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, new WriteBufferWaterMark(32 * 1024, 64 * 1024)) // 写缓冲水位
|
||||||
.childOption(ChannelOption.SO_REUSEADDR, true)
|
.childOption(ChannelOption.SO_REUSEADDR, true)
|
||||||
|
.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT) // 启用池化内存分配器
|
||||||
.childHandler(nettyServerChannelInitializer)
|
.childHandler(nettyServerChannelInitializer)
|
||||||
.localAddress(new InetSocketAddress(host, port));
|
.localAddress(new InetSocketAddress(host, port));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user