Home > Back-end >  Boost. An ASIO pressure test, the system and the compression memory high CPU
Boost. An ASIO pressure test, the system and the compression memory high CPU

Time:09-17

Recently in learning, an ASIO based on he has written a server framework, and to conduct stress tests:

Open a gateway server service Gate, two into oral Entry, a Game take Game; Open a client, when launched 4000 links, test process is as follows:

Client connection Gate, gain Entry address, disconnect Gate, after the success of the link, the link Entry once every 200 ms send local time to the server;
Received message server Entry, forward to the Game, the Game will be the client sending time, as is returned to the Entry, Entry forward again to the client, the client receives the message, local time, again is presupposed get difference, for statistical

The test environment:
CPU: the i5-3210 - m @ 2.5 GHZ CPU
Memory: 8 g

Test cases as shown in figure:


The log information output per second, the content is:
[the current number of connections] : the minimum time maximum time to deal with the number of messages the average time of the latest time

When the 4000 link, the server will receive 20000 messages per second, while the main CPU consumption in the system and compression memory, by looking at:

The main consumption here,

In addition I also tested on Windows 7, the main CPU consumption in the process of the System (NT Kernel & amp; System), and Windows 7 when the System with a CPU (quad core i5, System accounts for 25%), the whole System is card of death, at this time only 30% of the total CPU consumption,

And I was think too much process, single thread way to simplify the development, use cluster to improve performance, but now only 30% CPU card dead,,, heart good tired

The great god knows what causes of this situation, how should be optimized, or have any ideas, turn to for help!!!!!

CodePudding user response:

Don't talk about efficiency without profiler!! Especially in the cloud computing, virtual machine, simulator, CUDA, multi-core, multistage cache, command line, a variety of storage media,... In the age of flying!

CodePudding user response:

Why you can launch 4000 connection? My test program, a client can only be launched 70 connections, a server can accept 1800 + a connection,
  • Related