Azure / DotNetty

DotNetty project – a port of netty, event-driven asynchronous network application framework
Other
4.09k stars 977 forks source link

dotNetty eats 99% of CPU #486

Closed xiazhaozhao closed 5 years ago

xiazhaozhao commented 5 years ago

Environment OS: Window server 2012 R2 Description Please help.

ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap .Group(bossGroup, workerGroup) .Channel() .Option(ChannelOption.SoBacklog, 100) //.Option(ChannelOption.) .ChildHandler(new ActionChannelInitializer(channel => { IChannelPipeline pipeline = channel.Pipeline; if (tlsCertificate != null) { pipeline.AddLast(TlsHandler.Server(tlsCertificate)); } pipeline.AddLast(new IdleStateHandler(120, 0, 0));//第一个参数为读,第二个为写,第三个为读写全部 pipeline.AddLast(new CommunicationEncoder()); pipeline.AddLast(new CommunicationDecoder(0x76, 2048, 22)); pipeline.AddLast(new CmdServerHandler(_clientsList,redisClient)); }));

stratosblue commented 5 years ago

You can analysis it yourself with visualstudio diagnostic tools. step1. enable CPU analysis 1

step2. run and break it 2

step3. select time period and find what ate cpu 3

nayato commented 5 years ago

I'd suggest looking through your own code. The setup for dotnetty from what is shown is ok. Feel free to re-open if you see any more specific evidence it is dotnetty's issue. Meanwhile I'd suggest checking PerfView for performance analysis.