美文网首页
flannel VXLAN和UDP backend带宽对比测试

flannel VXLAN和UDP backend带宽对比测试

作者: BlueBlueSummer | 来源:发表于2019-08-02 09:58 被阅读0次

    背景

    上回我们说过,由于UDP方式是在用户层做转发,会多一次报文拷贝,因此性能上会比在内核做转发的vxlan差,但是没有具体数据总是不太直观,因此我们小测一波。

    准备

    在两个节点上起两个容器,安装上带宽测试工具iperf3,

    yum install -y iperf3

    之后分别在vxlan和UDP方式下测试即可。

    iperf3使用方式

    iperf3测试采用C/S方式,因此两个节点一个运行服务端,一个运行客户端。

    首先在服务端运行以下命令:

    [root@8d0db8f5a8b4 /]# iperf3 -s

    -----------------------------------------------------------

    Server listening on 5201

    -----------------------------------------------------------

    该命令让iperf3作为服务端,并监听5201端口,等待客户端连接。

    然后在客户端也就是另一个容器中,运行以下命令:

    [root@8d0db8f5a8b4 /]# iperf3 -c 10.108.69.2 -t 5

    Connecting to host 10.108.69.2, port 5201

    [  4] local 10.108.93.2 port 50028 connected to 10.108.69.2 port 5201

    [ ID] Interval          Transfer    Bandwidth      Retr  Cwnd

    [  4]  0.00-1.00  sec  45.1 MBytes  378 Mbits/sec    0  1.74 MBytes     

    [  4]  1.00-2.00  sec  97.5 MBytes  816 Mbits/sec    0  1.89 MBytes     

    [  4]  2.00-3.01  sec  152 MBytes  1.27 Gbits/sec    0  1.97 MBytes     

    [  4]  3.01-4.00  sec  128 MBytes  1.08 Gbits/sec  119  1.50 MBytes     

    [  4]  4.00-5.00  sec  136 MBytes  1.14 Gbits/sec    0  1.61 MBytes     

    - - - - - - - - - - - - - - - - - - - - - - - - -

    [ ID] Interval          Transfer    Bandwidth      Retr

    [  4]  0.00-5.00  sec  559 MBytes  937 Mbits/sec  119            sender

    [  4]  0.00-5.00  sec  554 MBytes  928 Mbits/sec                  receiver

    iperf Done.

    其中,

    -c 指定要连接的服务端,也就是第一个容器的ip

    -t 指定测试时间

    最后的输出我们可以看到,采用vxlan的发送带宽大概是937M/s。

    接下来换UDP作为backend来测试,

    [root@8d0db8f5a8b4 /]# iperf3 -c 10.8.46.2 -t 5

    Connecting to host 10.8.46.2, port 5201

    [  4] local 10.8.101.2 port 51674 connected to 10.8.46.2 port 5201

    [ ID] Interval          Transfer    Bandwidth      Retr  Cwnd

    [  4]  0.00-1.00  sec  16.7 MBytes  139 Mbits/sec  66    130 KBytes     

    [  4]  1.00-2.01  sec  14.3 MBytes  119 Mbits/sec  15    115 KBytes     

    [  4]  2.01-3.01  sec  11.8 MBytes  98.8 Mbits/sec    8    135 KBytes     

    [  4]  3.01-4.00  sec  12.3 MBytes  104 Mbits/sec  12    111 KBytes     

    [  4]  4.00-5.00  sec  19.4 MBytes  163 Mbits/sec  16    133 KBytes     

    - - - - - - - - - - - - - - - - - - - - - - - - -

    [ ID] Interval          Transfer    Bandwidth      Retr

    [  4]  0.00-5.00  sec  74.4 MBytes  125 Mbits/sec  117            sender

    [  4]  0.00-5.00  sec  74.0 MBytes  124 Mbits/sec                  receiver

    iperf Done.

    采用udp方式,发送带宽大概为125M/s,可见,vxlan的性能明显优于udp方式,大概是udp的7.5倍。

    相关文章

      网友评论

          本文标题:flannel VXLAN和UDP backend带宽对比测试

          本文链接:https://www.haomeiwen.com/subject/wfukdctx.html