简体   繁体   English

CentOS 中的网卡/网络性能调优

[英]NIC/Network performance tuning in CentOS

We run an UDP based app server in which we are expecting high traffic.我们运行一个基于 UDP 的应用程序服务器,我们期望在该服务器中获得高流量。 So I am in the process of tuning our NIC to achieve best performance with high throughput (compromising a little of latency).所以我正在调整我们的 NIC 以实现高吞吐量的最佳性能(牺牲一点延迟)。

For testing, I am using the 2 machines with the below configurations.为了进行测试,我使用具有以下配置的 2 台机器。

Machine Details机器详情

CPU : 40core
Threads per core: 2
Cores per socket : 2
NUMA node : 2
Model name : Intel(R) Xenon(R ) CPU E5-2630v4
CPU MHx: 2199.841
NUMA 0: 0-9, 20-29
NUMA 1: 10-19, 30-39
RAM: 128GB

NIC Details:网卡详情:

Driver: ixgbe
Version : 4.4.0-k-rh7.3
10G capable

While doing a simple load test I observed that the receiving rate (packets/sec) is not same as the sender.在进行简单的负载测试时,我观察到接收速率(数据包/秒)与发送方不同。

(Observing the stats through SAR command) Sender: (sar -n UDP 1) odgm/s (通过 SAR 命令观察统计数据)发送方:(sar -n UDP 1) odgm/s

1098825.00
1097993.00
1098103.00

Receiver: Idgm/s接收器: Idgm/s

622742.00
616321.00
649075.00

From the above, you can see the difference between the sender and receiver datagram packets.从上面可以看出发送方和接收方数据报包的区别。

Packet loss Observation:丢包观察:

Ethtool, netstat, sar - Observed stats in all these tools and no packet drop reported here. Ethtool、netstat、sar - 在所有这些工具中观察到的统计数据,这里没有报告丢包。

Currently tuned: ( with this tuning I was able to achieve max of 630k avg/ sec in receiver end)当前已调整:(通过此调整,我能够在接收器端实现最大 630k 平均/秒)

IRQBALANCE : disabled
CPU affinity   : manually distributed (each rx-tx queue / CPU)
Interrupt coalesce : rx-usecs 15
Flow control : on
Ring Buffer : rx 512
Rx Queue : 40
rmem_default = 16777216
rmem_max = 16777216

Rest all are default values Edit1: I changed to busy poll - 50 and was able to achieve better throughout but not consistent.其余都是默认值 Edit1:我更改为繁忙的投票 - 50 并且能够在整个过程中取得更好的成绩,但不一致。

  1. Why there is a difference in rate between the sender and receiver ?为什么发送方和接收方之间的速率存在差异? What all other NIC/OS params that can be tuned to achieve equal throughput rate as sender?可以调整哪些其他 NIC/OS 参数以实现与发送方相同的吞吐率?

  2. One strange thing that I observe using ethtool is this param “ rx_no_dma_resources ” keeps incrementing rapidly during the test.. Does it ring anything?我使用 ethtool 观察到的一件奇怪的事情是这个参数“ rx_no_dma_resources ”在测试期间不断快速增加......它是否响起任何东西?

  3. Even though I disabled “irqbalance” in /proc/interrupts and /proc/net/softnet_stat there is no equal distribution of interrupts.尽管我在 /proc/interrupts 和 /proc/net/softnet_stat 中禁用了“irqbalance”,但中断的分布并不均衡。
  4. Overall my ultimate goal is to achieve the best throughput with minimum packet loss.总的来说,我的最终目标是以最小的数据包丢失实现最佳吞吐量。

I don't have answers to all your questions and also not specific centos.我没有你所有问题的答案,也没有特定的 centos。 It is my previous experience with the interrupt based packet receiving.这是我以前在基于中断的数据包接收方面的经验。

As you mentioned that you need best throughput, interrupt based method is not a way to go.正如您提到的,您需要最佳吞吐量,基于中断的方法不是一种方法。 In one of the project we did, We identified that interrupt based method has huge overhead due to context switch hence huge number of packets are discarded.在我们所做的一个项目中,我们发现基于中断的方法由于上下文切换而具有巨大的开销,因此会丢弃大量数据包。 I suggest you to use polling with low polling frequency.我建议您使用轮询频率较低的轮询。 Although it causes more execution overhead.虽然它会导致更多的执行开销。 You will be able to achieve better throughput.您将能够获得更好的吞吐量。

I hope my suggestion will be useful for your project.我希望我的建议对您的项目有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM