flannel-io / flannel

flannel is a network fabric for containers, designed for Kubernetes
Apache License 2.0
8.61k stars 2.87k forks source link

flannel vxlan loss of 30% of performance #1816

Closed tanberBro closed 6 months ago

tanberBro commented 8 months ago

In my environment, I use the flannel vxlan mode for cross-host pod access performance testing, and there is about a 30% bandwidth drop. The following is my test data:

pod2 on node2:

iperf -c 10.244.3.134 -t 30 -i5 -e
------------------------------------------------------------
Client connecting to 10.244.3.134, TCP port 5001 with pid 49
Write buffer size:  128 KByte
TCP window size:  526 KByte (default)
------------------------------------------------------------
[  3] local 10.244.4.31 port 53918 connected with 10.244.3.134 port 5001 (ct=0.72 ms)
[ ID] Interval        Transfer    Bandwidth       Write/Err  Rtry     Cwnd/RTT        NetPwr
[  3] 0.00-5.00 sec  3.63 GBytes  6.24 Gbits/sec  29746/0          0      161K/438 us  1780304.89
[  3] 5.00-10.00 sec  3.68 GBytes  6.32 Gbits/sec  30127/0       2615      311K/441 us  1790841.79
[  3] 10.00-15.00 sec  3.96 GBytes  6.80 Gbits/sec  32437/0       3398      533K/608 us  1398546.86
[  3] 15.00-20.00 sec  4.32 GBytes  7.43 Gbits/sec  35413/0       3343      606K/614 us  1511939.00
[  3] 20.00-25.00 sec  3.73 GBytes  6.41 Gbits/sec  30565/0       3160      716K/642 us  1248042.27
[  3] 25.00-30.00 sec  3.59 GBytes  6.17 Gbits/sec  29441/0       5504      653K/510 us  1513290.49
[  3] 0.00-30.00 sec  22.9 GBytes  6.56 Gbits/sec  187729/0      18020       -1K/542 us  1513244.28

My Environment

rbrtbnfgl commented 8 months ago

Hi the two nodes are directly connected with a 10G connection? You have also to consider the overhead of the VXLAN header and the linux forwarding. You can try to check the throughput of iperf with UDP too