我正试图在2台服务器上组合3个网卡。 我试图达到3Gbps的最大吞吐量来复制服务器之间的数据。 设置很简单,我有2个服务器与3千兆网卡连接在同一个Cisco交换机上。 服务器1的端口1-2-3和服务器2的端口4-5-6完全相同。 我的接口configuration如下所示:
auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet manual bond-master bond0 auto eth1 iface eth1 inet manual bond-master bond0 auto eth2 iface eth2 inet manual bond-master bond0 auto bond0 iface bond0 inet static address 192.168.1.11 netmask 255.255.255.0 gateway 192.168.1.1 bond-miimon 100 bond-mode 802.3ad #bond-downdelay 200 #bond-updelay 200 bond-lacp-rate 1 # tried bond with slaves and no slaves interfaces bond-slaves eth0 eth1 eth2 # bond-slaves none
我在这些卡上尝试了多个configuration,但是我最终总是只使用1个网卡。
我用iperf和netcattesting了性能
# server-1 iperf -s # server-2 iperf -c 192.168.1.10 # Wait for trafic nc.traditional -l -p 5000 | pv > /dev/null # Push trafic dd if=/dev/zero | pv | nc.traditional 192.168.1.11 5000
我们还在思科交换机上尝试了许多configuration,没有端口通道和端口通道,而且当时只有一个网卡。 如果我们单独testing每个工作在1Gbps的卡。
我也可以说在/ proc / net / bonding / bond0模式下显示802.3ad,LACP速率显示为FAST。 我没有链接计数失败,3个界面显示。 我也用ethtoolvalidation每个eth接口,他们看起来对我很好。
我按照这个指南设置它https://help.ubuntu.com/community/UbuntuBonding和我使用modprobe bonding在内核绑定模块,当我用lsmod来validation绑定模块是否启动,是的在列表中。
我们错过了什么让这个工作?
两台服务器之间的性能不会超过1个NIC。 交换机不会将来自单个源的帧跨链路聚合组(LAG)中的多个链路进行传播。 他们实际上做的是散列源MAC或IP(或两者),并使用该散列来分配客户端到一个NIC。
因此,您的服务器可以根据您的需要传输尽可能多的NIC,但这些帧将全部在一个链路上发送到目标服务器。
testingLAG使用多个线程,因此他们使用多个链接。 使用netperf尝试:
netperf -H ipaddress & netperf -H ipaddress & netperf -H ipaddress & netperf -H ipaddress & netperf -H ipaddress &
你应该看到一些交通击中债券的其他奴隶。
我在LACP债券中有四个10GbE端口,在两台服务器之间每路都有32Gb到36Gb。
另一种方法是在多个IP地址的绑定上设置别名,然后启动多个netperf实例到不同的地址。
使用英特尔至强处理器X5690的服务器具有足够的功率来驱动每个内核接近10Gb。
我已经驱动了8GbE端口的80Gb单向stream量。 关键是在交换机和网卡上使用l3 + l4散列,并使用多个线程。
这里是我的4x10GbEconfiguration的一个例子…我的接口configuration文件:
#Ports that will be used for VXLAN Traffic in on Bond0 auto p4p1 auto p4p2 auto p6p1 auto p6p2 iface p4p1 inet manual bond-master bond0 iface p4p2 inet manual bond-master bond0 iface p6p1 inet manual bond-master bond0 iface p6p2 inet manual bond-master bond0 #Configure Bond0. Setup script will provide VXLAN VLAN configuration on bond0 auto bond0 iface bond0 inet manual #address 10.3.100.60 #netmask 255.255.0.0 bond-mode 4 bond-slaves none bond-lacp-rate 0 bond-ad-select 1 bond-miimon 100 bond-xmit_hash_policy 1
cat / proc / net / bonding / bond0
root@host2:~# cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: IEEE 802.3ad Dynamic link aggregation Transmit Hash Policy: layer3+4 (1) MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 802.3ad info LACP rate: slow Min links: 0 Aggregator selection policy (ad_select): bandwidth Active Aggregator Info: Aggregator ID: 2 Number of ports: 4 Actor Key: 33 Partner Key: 32768 Partner Mac Address: 54:7f:ee:e3:01:41 Slave Interface: p6p1 MII Status: up Speed: 10000 Mbps Duplex: full Link Failure Count: 1 Permanent HW addr: 90:e2:ba:47:2b:e4 Aggregator ID: 2 Slave queue ID: 0 Slave Interface: p4p2 MII Status: up Speed: 10000 Mbps Duplex: full Link Failure Count: 1 Permanent HW addr: 90:e2:ba:47:2b:69 Aggregator ID: 2 Slave queue ID: 0 Slave Interface: p4p1 MII Status: up Speed: 10000 Mbps Duplex: full Link Failure Count: 1 Permanent HW addr: 90:e2:ba:47:2b:68 Aggregator ID: 2 Slave queue ID: 0 Slave Interface: p6p2 MII Status: up Speed: 10000 Mbps Duplex: full Link Failure Count: 1 Permanent HW addr: 90:e2:ba:47:2b:e5 Aggregator ID: 2 Slave queue ID: 0
这是运行netperf的多个实例的结果:
root@host6:~# vnstat -i bond0.192 -l Monitoring bond0.192... (press CTRL-C to stop) rx: 36.83 Gbit/s 353202 p/s tx: 162.40 Mbit/s 314535 p/s bond0.192 / traffic statistics rx | tx --------------------------------------+------------------ bytes 499.57 GiB | 2.15 GiB --------------------------------------+------------------ max 36.90 Gbit/s | 170.52 Mbit/s average 20.05 Gbit/s | 86.38 Mbit/s min 0 kbit/s | 0 kbit/s --------------------------------------+------------------ packets 39060415 | 34965195 --------------------------------------+------------------ max 369770 p/s | 330146 p/s average 186891 p/s | 167297 p/s min 0 p/s | 0 p/s --------------------------------------+------------------ time 3.48 minutes
希望这可以帮助…
对不起,发布这个答案。 我无法对@ longneck的答案添加评论,可能是由于缺乏声誉…?
在两台服务器之间可以获得超过1个NIC的性能,因为交换机不仅能够根据MAC / IP分配stream量,还能够根据端口号分配stream量。 思科设备能够做到这一点,但是您可能必须configuration交换机来查看L4端口,而不是仅仅是L2和L3地址,这可能是默认的。
两台服务器之间可能无法获得超过1个NIC性能的真正原因是因为1Gbps双向交换是任何现代CPU可处理的大量stream量。 我不知道你的服务器有多么的不稳定,但是如果服务器对每个数据包都做了有意义的事情,那么如果服务器能够处理1Gbps全双工,我会感到惊讶。
对不起,并不意味着踩上面的@ longneck的答案,只是想澄清一些额外的观点。