System performance evaluation key time-consuming indicators

The following indicators can be used for system performance evaluation, and different CPU architectures are slightly different. can be used as a reference

1) When testing system calls, the minimum value is 200ns


2) On average, each context switch takes about 3.5us


3) The cost of each thread switching is about 3.8us


4) From the time-consuming perspective of context switching, Linux threads (lightweight processes) are actually not much different from processes, and the
overhead of context switching is about 2.7-5.48us.


5) Calculate the time consumption of each soft interrupt - the machine is a 16-core physical machine, so it can be concluded that the CPU time required for each soft interrupt is = 12ms/(56000/16) times = 3.428us

6) Time-consuming for a tcp connection: approximately equal to 1 RTT in the absence of exceptions

The machine consumes an average of 0.048ms per TCP connection. Slightly higher than ping latency. This is because when the RTT becomes small enough, the time-consuming overhead of the kernel CPU will appear. In addition, the TCP connection is more complicated than the icmp protocol of ping, so it is normal to be slightly higher than the ping delay by about 0.02ms.

In the same computer room, the ping delay is around 0.2ms~0.3ms. After running the above script, the experimental result is that 50000 TCP connections consume a total of 11605ms, with an average of 0.23ms each time

Next, I changed a target server, which is located in Beijing. There is some distance from Huailai, but it is much closer than Guangdong. The RTT of this ping is about 1.6~1.7ms. After the client statistics establish 50,000 connections, the calculation time of each connection is 1.64ms. 

reference:

Talk about the time-consuming things about TCP connections

Guess you like

Origin blog.csdn.net/huapeng_guo/article/details/131089518