当前位置:网站首页>The author of surging issued the pressure test results

The author of surging issued the pressure test results

2022-07-19 04:28:00 u012804784

High quality resource sharing

Learning route guidance ( Click unlock ) Knowledge orientation Crowd positioning
🧡 Python Actual wechat ordering applet 🧡 Progressive class This course is python flask+ Perfect combination of wechat applet , From the deployment of Tencent to the launch of the project , Create a full stack ordering system .
Python Quantitative trading practice beginner Take you hand in hand to create an easy to expand 、 More secure 、 More efficient quantitative trading system

Preface

First respond @wen-wen Pressure test report posted , I also put the problems I encountered in the pressure test with customers , And the pressure measurement results are posted , This result is provided by the customer . There will be no fraud

Question 1 :Task.Run Use with caution

First of all, the latest community version has put Task.run All have been removed ( It includes kestrel RPC Call the service ), When your program has time-consuming business processing ,Task Can improve performance , But when it doesn't take time , Maybe you can't improve performance , Instead, it becomes a bottleneck , Because when a batch Task.run Not finished , A new batch of requests has come , It will block and cause cpu The rise of , So before netty Of ServerHandler Use in task.run , When testing services without business , Because they are nanosecond responses , So it created task The block , Perform 10000 times of cyclic pressure measurement ,CPU Has been 20% about , The follow-up has passed netty Business thread of ,CPU Has been stable in 6% about , The code is as follows

?

| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | if(_logger.IsEnabled(LogLevel.Debug))``_logger.LogDebug($``" Ready to start the service host , Monitor address :{endPoint}."``); IEventLoopGroup bossGroup =newMultithreadEventLoopGroup(1);``IEventLoopGroup workerGroup =newMultithreadEventLoopGroup();``//Default eventLoopCount is Environment.ProcessorCount * 2``varbootstrap =newServerBootstrap(); if(AppConfig.ServerOptions.Libuv)``{``vardispatcher =newDispatcherEventLoopGroup();``bossGroup = dispatcher;``workerGroup =newWorkerEventLoopGroup(dispatcher);``bootstrap.Channel();``}``else``{``bossGroup =newMultithreadEventLoopGroup(1);``workerGroup =newMultithreadEventLoopGroup();``bootstrap.Channel();``}``varworkerGroup1 =newSingleThreadEventLoop();``// Declare business threads ``bootstrap``.Option(ChannelOption.SoBacklog, AppConfig.ServerOptions.SoBacklog)``.ChildOption(ChannelOption.Allocator, PooledByteBufferAllocator.Default).Group(bossGroup, workerGroup)``.ChildHandler(``newActionChannelInitializer(channel =>``{``varpipeline = channel.Pipeline;``pipeline.AddLast(``newLengthFieldPrepender(4));``pipeline.AddLast(``newLengthFieldBasedFrameDecoder(``int``.MaxValue, 0, 4, 0, 4));``pipeline.AddLast(workerGroup1,"HandlerAdapter"``,newTransportMessageChannelHandlerAdapter(_transportMessageDecoder));``// Add business thread processing ``// Add business thread processing                 pipeline.AddLast(workerGroup1, "ServerHandler", new ServerHandler(async (contenxt, message) =>{``varsender =newDotNettyServerMessageSender(_transportMessageEncoder, contenxt);``await OnReceived(sender, message);``},  _logger));``}));``try``{``_channel = await bootstrap.BindAsync(endPoint);``if(_logger.IsEnabled(LogLevel.Debug))``_logger.LogDebug($``" Service host started successfully , Monitor address :{endPoint}."``);``}``catch``{``_logger.LogError($``" Service host failed to start , Monitor address :{endPoint}. "``);    }        } |

Question two : Check the dominant frequency , Check the number

First of all, the customer started the test with a home computer , He has been unable to measure , Talking and using jmeter Yes? 2000 Just timeout 了 , I learned later that his computer is 4 nucleus , Main frequency 1.8, Memory 32G, Later, tell him that you need a high-frequency or multi-core clean computer to meet your expectations .

?

| 1 |   |

Question 3 : Check the fusing strategy

Check MaxConcurrentRequests,ExecutionTimeoutInMilliseconds  Wait for settings

Customer results

Add a database to a single table , cpu Keep it all the time 30%, May be because ingress The setting relationship can only be measured 4000

Personal test results

No business stress test :

use httpkestrel Pressure measurement can achieve 2w/s,   rpc  You can achieve 10w/s

rpc Everyone can test ,  Download through the community version , Enable server, Turn on multiple client Carry out pressure test , You can tell me if you have any questions

summary

surging It is developing towards Pingtai , The prototype of community version should be launched at the end of the year , Please pay more attention .

原网站

版权声明
本文为[u012804784]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/200/202207170407394359.html