1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-07 21:51:34 +08:00
parent 7d7cc0d174
commit d83d76ca8e
5 changed files with 17 additions and 37 deletions

View File

@@ -27,8 +27,14 @@ func (s *Server) Boot(serverid, port uint16) error {
gnet.WithMulticore(true),
gnet.WithTicker(true),
// gnet.WithReusePort(true),
// gnet.WithReuseAddr(true),
// 其他调优配置↓
gnet.WithTCPNoDelay(gnet.TCPNoDelay), // 禁用Nagle算法降低延迟适合小数据包场景
gnet.WithReusePort(true), // 开启SO_REUSEPORT多核下提升并发
gnet.WithReadBufferCap(1024*64), // 读缓冲区64KB根据业务调整默认太小
gnet.WithWriteBufferCap(1024*64), // 写缓冲区64KB
gnet.WithLockOSThread(true), // 绑定goroutine到OS线程减少上下文切换
gnet.WithSocketRecvBuffer(s.bufferSize))
if err != nil {
panic(err)