为什么我的吉比特债券不能提供至less150 MB / s的吞吐量?

我直接在两个不同的PCIe适配器上连接两台PowerEdge 6950交叉(使用直线)。

我在这些线路(1000兆,全双工,双向stream量控制)上都得到一个千兆链路。

现在我正尝试使用两边的rralgorithm将这些接口绑定到bond0(我希望获得单个IP会话的2000 MBit)。

当我通过在tcp模式下使用dd bs = 1M和netcat将/ dev / zero传输到/ dev / null来testing吞吐量时,我得到的吞吐量为70 MB / s,而不像预期的那样大于150MB / s。

当我使用单行的时候,如果每行使用不同的方向,我会在每行上得到大约98 MB / s。 当我使用单线时,如果stream量进入“相同”方向,则可以获得70 MB / s和90 MB / s的速度。

读完bonding-readme(/usr/src/linux/Documentation/networking/bonding.txt)后,我发现以下部分是有用的:(13.1.1单交换机拓扑的MT绑定模式select)

balance-rr:此模式是允许单个TCP / IP连接跨多个接口分段stream量的唯一模式。 因此,它是唯一允许单个TCP / IPstream利用多个接口的吞吐量的模式。 然而,这是有代价的:分条通常会导致对等系统无序地接收数据包,从而导致TCP / IP的拥塞控制系统通常通过重新传输数据段来启动。

It is possible to adjust TCP/IP's congestion limits by altering the net.ipv4.tcp_reordering sysctl parameter. The usual default value is 3, and the maximum useful value is 127. For a four interface balance-rr bond, expect that a single TCP/IP stream will utilize no more than approximately 2.3 interface's worth of throughput, even after adjusting tcp_reordering. Note that this out of order delivery occurs when both the sending and receiving systems are utilizing a multiple interface bond. Consider a configuration in which a balance-rr bond feeds into a single higher capacity network channel (eg, multiple 100Mb/sec ethernets feeding a single gigabit ethernet via an etherchannel capable switch). In this configuration, traffic sent from the multiple 100Mb devices to a destination connected to the gigabit device will not see packets out of order. However, traffic sent from the gigabit device to the multiple 100Mb devices may or may not see traffic out of order, depending upon the balance policy of the switch. Many switches do not support any modes that stripe traffic (instead choosing a port based upon IP or MAC level addresses); for those devices, traffic flowing from the gigabit device to the many 100Mb devices will only utilize one interface. 

现在我在所有线路(4)上的连接的服务器上将该参数从3改为127。

再次粘合后,我得到约100 MB / s,但仍然不超过。

任何想法为什么?

更新:来自lspci -v硬件细节:

 24:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) Subsystem: Intel Corporation PRO/1000 PT Dual Port Server Adapter Flags: bus master, fast devsel, latency 0, IRQ 24 Memory at dfe80000 (32-bit, non-prefetchable) [size=128K] Memory at dfea0000 (32-bit, non-prefetchable) [size=128K] I/O ports at dcc0 [size=32] Capabilities: [c8] Power Management version 2 Capabilities: [d0] MSI: Mask- 64bit+ Count=1/1 Enable- Capabilities: [e0] Express Endpoint, MSI 00 Kernel driver in use: e1000 Kernel modules: e1000 

更新最终结果:

8589934592字节(8.6 GB)复制,35.8489秒,240 MB / s

我改变了很多tcp / ip和低级驱动程序选项。 这包括扩大networking缓冲区。 这就是为什么dd现在显示大于200 MB / s的数字:在仍然有输出等待传输(在发送缓冲区中)时,dd终止。

更新2011-08-05:已更改为实现目标( /etc/sysctl.conf )的设置:

 # See http://www-didc.lbl.gov/TCP-tuning/linux.html # raise TCP max buffer size to 16 MB. default: 131071 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 # raise autotuninmg TCP buffer limits # min, default and max number of bytes to use # Defaults: #net.ipv4.tcp_rmem = 4096 87380 174760 #net.ipv4.tcp_wmem = 4096 16384 131072 # Tuning: net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 # Default: Backlog 300 net.core.netdev_max_backlog = 2500 # # Oracle-DB settings: fs.file-max = 6815744 fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 kernel.shmmax = 2147659776 kernel.sem = 1250 256000 100 1024 net.core.rmem_default = 262144 net.core.wmem_default = 262144 # # Tuning for network-bonding according to bonding.txt: net.ipv4.tcp_reordering=127 

绑定设备的特殊设置(SLES: / etc / sysconfig / network / ifcfg-bond0 ):

 MTU='9216' LINK_OPTIONS='txqueuelen 10000' 

请注意,设置最大可能的MTU是解决scheme的关键。

调整涉及的网卡的rx / tx缓冲区:

 /usr/sbin/ethtool -G eth2 rx 2048 tx 2048 /usr/sbin/ethtool -G eth4 rx 2048 tx 2048 

我曾经有一个类似的问题,试图通过两个千兆位链路来提高drbd同步的速度。 最后,我设法获得了约150MB /秒的同步速度。 这些是我在两个节点上应用的设置:

 ifconfig bond0 mtu 9000 ifconfig bond0 txqueuelen 10000 echo 3000 > /proc/sys/net/core/netdev_max_backlog 

如果您还没有网卡( ethtool –coalesce ),也可以尝试启用中断合并

你在交换机上configuration了这个双向中继吗? 如果不是,那么就不能这样工作,它只能在主动/被动模式下工作,只能使用1Gbps链路中的一个。

它看起来像PowerEdge 6950是有限的PCI插槽可以在整个总线上共享133 MB / s。 您可能会看到系统总线体系结构本身的I / O限制。

除了具有不同硬件和I / O体系结构的其他系统进行testing之外,布线也可能会发挥作用。 一些可能的组合可能沿着不同评级(5e对6)以及长度(更短并不总是更好)的线。

巨型帧?

 ifconfig <interface> mtu 9000 

做巨型框架是一个巨大的帮助,只要你的开关和networking支持它。 如果你有一个非托pipe的networking,很可能你不会得到任何你想要的带宽,但是如果你把交换机上的端口绑定在一起,情况就不是这样了。 这是很久以前学过的东西,65%的时间,这是一个实际问题。 你使用cat6电缆吗?

如果你在你的nics上configuration了巨型帧,那么你必须确保你已经configuration了交换机来支持高MTU。

巨型帧在千兆networking上是一个很好的性能,但是您需要确保您已经将它们configuration为端到端(源服务器和目标服务器以及它们使用的networking交换机)。