「CEPH」- 性能测试:测试网络性能

Bandwidth

网络吞吐是另外一个重要的指标。可以使用 iperf 进行测试,它通过创建 Server/Client 连接进行 TCP 与 UDP 的吞吐测试;

使用方法相较简单:需要两台机器,分别是 Client 与 Server:

# 在 Server 上
iperf3 -s -p 6900

# 在 Client 上
# 当命令执行结束时,将显示网络最大吞吐;
# iperf3 -p 6900 -c 172.31.253.240
Connecting to host 172.31.253.240, port 6900
[  5] local 172.31.253.248 port 38848 connected to 172.31.253.240 port 6900
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   114 MBytes   956 Mbits/sec    0    413 KBytes       
[  5]   1.00-2.00   sec   109 MBytes   919 Mbits/sec   16    499 KBytes       
[  5]   2.00-3.00   sec   111 MBytes   927 Mbits/sec    0    499 KBytes       
[  5]   3.00-4.00   sec   111 MBytes   933 Mbits/sec    0    499 KBytes       
[  5]   4.00-5.00   sec   112 MBytes   943 Mbits/sec    0    499 KBytes       
[  5]   5.00-6.00   sec   112 MBytes   943 Mbits/sec    0    499 KBytes       
[  5]   6.00-7.00   sec   111 MBytes   933 Mbits/sec    0    499 KBytes       
[  5]   7.00-8.00   sec   113 MBytes   945 Mbits/sec    0    619 KBytes       
[  5]   8.00-9.00   sec   112 MBytes   941 Mbits/sec    0    619 KBytes       
[  5]   9.00-10.00  sec   111 MBytes   931 Mbits/sec    0    619 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   937 Mbits/sec   16             sender
[  5]   0.00-10.04  sec  1.09 GBytes   931 Mbits/sec                  receiver

iperf Done.

Latency

# ping 172.31.253.240
PING 172.31.253.240 (172.31.253.240) 56(84) bytes of data.
64 bytes from 172.31.253.240: icmp_seq=1 ttl=64 time=0.191 ms
64 bytes from 172.31.253.240: icmp_seq=2 ttl=64 time=0.278 ms
64 bytes from 172.31.253.240: icmp_seq=3 ttl=64 time=0.476 ms
64 bytes from 172.31.253.240: icmp_seq=4 ttl=64 time=0.384 ms
64 bytes from 172.31.253.240: icmp_seq=5 ttl=64 time=0.513 ms
...

# ping 172.31.253.249
PING 172.31.253.249 (172.31.253.249) 56(84) bytes of data.
64 bytes from 172.31.253.249: icmp_seq=1 ttl=64 time=0.127 ms
64 bytes from 172.31.253.249: icmp_seq=2 ttl=64 time=0.128 ms
64 bytes from 172.31.253.249: icmp_seq=3 ttl=64 time=0.300 ms
64 bytes from 172.31.253.249: icmp_seq=4 ttl=64 time=0.283 ms
64 bytes from 172.31.253.249: icmp_seq=5 ttl=64 time=0.228 ms

我们将延迟视为 0.5ms