首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在10 to光纤连接的Linux上微调TCP性能

如何在10 to光纤连接的Linux上微调TCP性能
EN

Server Fault用户
提问于 2016-02-17 21:55:57
回答 3查看 21.3K关注 0票数 10

我们有两个红帽服务器,是专门为客户速度测试。它们都使用10 on光纤连接,并位于10 on链路上。这些服务器之间的所有网络设备都完全支持10 get /S。使用Iperf或Iperf3,我所能得到的最好值是6.67Gb/s。也就是说,一台服务器正在生产(客户正在点击它),另一台服务器正在运行,但没有被使用。(我们用它来测试自动取款机) 6.67Gb/s也是一种方式,我应该提一下。我们将这些服务器称为服务器A和服务器B。

当服务器A充当iperf服务器时,我们得到6.67Gb/s的速度。当服务器A充当服务器B的客户端时,只能推送大约20 to /S。

我所做的:

到目前为止,我所做的唯一的事情就是将两个服务器上的TX/RX缓冲区增加到最大。其中一个设置为512,另一个设置为453。(仅在RX上,TX已经最大)所以在更新之后,在这两个方面都是这样的:

代码语言:javascript
复制
Server A:
Ring parameters for em1:
Pre-set maximums:
RX:     4096
RX Mini:    0
RX Jumbo:   0
TX:     4096
Current hardware settings:
RX:     4096
RX Mini:    0
RX Jumbo:   0
TX:     4096

Server B:
Ring parameters for p1p1:
Pre-set maximums:
RX:     4078
RX Mini:    0
RX Jumbo:   0
TX:     4078
Current hardware settings:
RX:     4078
RX Mini:    0
RX Jumbo:   0
TX:     4078

NICS看起来是这样的:

代码语言:javascript
复制
Server A: 
ixgbe 0000:01:00.0: em1: NIC Link is Up 10 Gbps, Flow Control: RX/TX

Serer B:
bnx2x 0000:05:00.0: p1p1: NIC Link is Up, 10000 Mbps full duplex,     Flow control: ON - receive & transmit

Server A ethtool stats:
 rx_errors: 0
 tx_errors: 0
 rx_over_errors: 0
 rx_crc_errors: 0
 rx_frame_errors: 0
 rx_fifo_errors: 0
 rx_missed_errors: 0
 tx_aborted_errors: 0
 tx_carrier_errors: 0
 tx_fifo_errors: 0
 tx_heartbeat_errors: 0
 rx_long_length_errors: 0
 rx_short_length_errors: 0
 rx_csum_offload_errors: 123049

 Server B ethtool stats:
 [0]: rx_phy_ip_err_discards: 0
 [0]: rx_csum_offload_errors: 0
 [1]: rx_phy_ip_err_discards: 0
 [1]: rx_csum_offload_errors: 0
 [2]: rx_phy_ip_err_discards: 0
 [2]: rx_csum_offload_errors: 0
 [3]: rx_phy_ip_err_discards: 0
 [3]: rx_csum_offload_errors: 0
 [4]: rx_phy_ip_err_discards: 0
 [4]: rx_csum_offload_errors: 0
 [5]: rx_phy_ip_err_discards: 0
 [5]: rx_csum_offload_errors: 0
 [6]: rx_phy_ip_err_discards: 0
 [6]: rx_csum_offload_errors: 0
 [7]: rx_phy_ip_err_discards: 0
 [7]: rx_csum_offload_errors: 0
 rx_error_bytes: 0
 rx_crc_errors: 0
 rx_align_errors: 0
 rx_phy_ip_err_discards: 0
 rx_csum_offload_errors: 0
 tx_error_bytes: 0
 tx_mac_errors: 0
 tx_carrier_errors: 0
 tx_deferred: 0
 recoverable_errors: 0
 unrecoverable_errors: 0

潜在问题:服务器A有大量的rx_csum_offload_errors。服务器A是生产中的服务器,我不得不认为CPU中断可能是造成我看到的错误的一个潜在因素。

来自服务器A的cat /proc/中断:

代码语言:javascript
复制
122:   54938283          0          0          0          0            0          0          0          0          0          0          0            0          0          0          0          0          0          0           0          0          0          0          0  IR-PCI-MSI-edge      em1-  TxRx-0
123:   51653771          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-1
124:   52277181          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-2
125:   51823314          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-3
126:   57975011          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-4
127:   52333500          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-5
128:   51899210          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-6
129:   61106425          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-7
130:   51774758          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-8
131:   52476407          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-9
132:   53331215          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI-edge      em1-TxRx-10
133:   52135886          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0

如果这是问题所在,禁用rx-校验和会有帮助吗?此外,我看到服务器上没有CPU中断,这是合理的,因为它的NIC不需要CPU时间。

代码语言:javascript
复制
Server A:
 ethtool -k em1
Features for em1:
rx-checksumming: on
tx-checksumming: on
tx-checksum-ipv4: on
tx-checksum-unneeded: off
tx-checksum-ip-generic: off
tx-checksum-ipv6: on
tx-checksum-fcoe-crc: on [fixed]
tx-checksum-sctp: on [fixed]
scatter-gather: on
tx-scatter-gather: on
tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on
tx-tcp-segmentation: on
tx-tcp-ecn-segmentation: off
tx-tcp6-segmentation: on
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: on
rx-vlan-offload: on
tx-vlan-offload: on
ntuple-filters: off
receive-hashing: on
highdma: on [fixed]
rx-vlan-filter: on [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: on [fixed]
tx-gre-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
fcoe-mtu: off [fixed]
loopback: off [fixed]

除了使用大帧(这是不可能的,因为我们的网络设备不支持它们)之外,我还能做什么或检查以为我的10 my网络提供最优的TCP性能呢?6.67Gb/s并没有那么糟糕,考虑到其中一台服务器正在生产,而且我关于CPU中断NIC生成的假设。但是,在10 is链路上,20 is/S在另一个方向上的速度是完全不能接受的。任何帮助都将不胜感激。

服务器A规格: x64 24v CPU 32 Server RHEL6.7

服务器B规范: x64 16vcpu 16 ram ram RHEL6.7

EN

回答 3

Server Fault用户

发布于 2016-02-17 22:28:03

服务器是否具有相同的规格(制造和型号)?您做过任何sysctl.conf更改吗?

您应该启用irqbalance,因为您的中断只发生在CPU0上。

如果您没有在EL6中使用调优配置文件,则应该根据调度这里选择一个与工作负载相近的配置文件。

票数 4
EN

Server Fault用户

发布于 2016-02-18 11:01:09

速度6GB/S是可以的,如果您只运行一个实例的iperf,因为它仅限于单CPU核心。两个过程同时应该给你预期的10 you /S。

20 in /S在一个方向上的问题看起来像是驱动程序/固件/硬件不兼容问题。

我建议您尝试以下故障排除步骤:

您的NIC有两个端口,所以首先,尝试在两个NIC上进行回送速度测试。它可以帮助您定位问题:在服务器A或服务器B. 2.更改修补程序线。3.尝试新的司机。4.升级固件。5.改变新工业化国家)

票数 2
EN

Server Fault用户

发布于 2018-01-12 15:14:37

我会尝试禁用LRO (大型接收卸载)..。我猜你开了一个,关了一个。

它依赖于NIC /驱动程序,但一般来说,当我们看到在我们的环境中,我们知道我们错过了一个,然后去禁用LRO

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/757961

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档