网络性能测试的最佳实践 一对一场景 测试准备 类型 数量 镜像 规格 被测机(被测机:被压力测试网络性能的弹性云服务器,可作为 iperf3 测试中的 client 端(发送端)) 1台 CTyunOS 23.01(推荐) 4C8G(推荐) 辅助云服务器(作为 iperf3 测试中的 server 端(接收端)) 1台 CTyunOS 23.01(推荐) 4C8G(推荐) 准备两台处于不同计算节点的弹性云主机,网络可达,分别安装iperf,添加对应的安全组规则、防护墙规则放行。 测试TCP吞吐量 1. TCP发送带宽。 Server端开启iperf的服务器模式,指定TCP端口:10000,安全组规则入方向放行TCP 10000端口 [root@ssdaliu2 ~] iperf3 s i 1 p 10000 Server listening on 10000 (test 1) Client端启动iperf的客户端模式,连接服务端。ip为server端地址 [root@ssdaliu1 ~] iperf3 c 192.168.0.15 i 1 t 60 p 10000 Connecting to host 192.168.0.15, port 10000 [ 5] local 192.168.0.8 port 37720 connected to 192.168.0.15 port 10000 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.001.00 sec 332 MBytes 2.78 Gbits/sec 4394 167 KBytes ... ... ... [ 5] 52.0053.00 sec 180 MBytes 1.51 Gbits/sec 6546 130 KBytes [ 5] 53.0054.00 sec 166 MBytes 1.39 Gbits/sec 5237 180 KBytes [ 5] 54.0055.00 sec 166 MBytes 1.40 Gbits/sec 5505 19.8 KBytes [ 5] 55.0056.00 sec 207 MBytes 1.74 Gbits/sec 7651 12.7 KBytes [ 5] 56.0057.00 sec 167 MBytes 1.40 Gbits/sec 5822 314 KBytes [ 5] 57.0058.00 sec 168 MBytes 1.41 Gbits/sec 5952 58.0 KBytes [ 5] 58.0059.00 sec 178 MBytes 1.49 Gbits/sec 6940 372 KBytes [ 5] 59.0060.00 sec 205 MBytes 1.72 Gbits/sec 6756 2.83 KBytes [ ID] Interval Transfer Bitrate Retr [ 5] 0.0060.00 sec 10.7 GBytes 1.53 Gbits/sec 343419 sender [ 5] 0.0060.00 sec 10.7 GBytes 1.53 Gbits/sec receiver 结果说明: Interval表示时间间隔。 Transfer表示时间间隔里面转输的数据量。 Bitrate是时间间隔里的传输速率。 2. TCP接收带宽。