Fer*_*ndo 2 networking ifconfig centos6
我有一台 Centos 6 服务器,可以处理大量流量。我发现 RX 溢出一直在增加:
RX packets:11191345002 errors:0 dropped:0 overruns:35592596 frame:0
TX packets:15262461573 errors:0 dropped:0 overruns:0 carrier:0
RX bytes:1871320014951 (1.7 TiB) TX bytes:12673638434114 (11.5 TiB)
Run Code Online (Sandbox Code Playgroud)
根据http://www.tldp.org/LDP/nag2/x-087-2-iface.ifconfig.html
当数据包进入的速度快于内核处理最后一个中断的速度时,通常会发生接收器溢出。
应该调整哪些内核参数来解决这个问题?
我建议tuned-adm为您的 I/O 配置使用适当的配置文件。对于这个设置,听起来似乎yum install tuned-utils很有帮助tuned-adm profile enterprise storage。
在内核端,您可以设置发送/接收缓冲区:
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
Run Code Online (Sandbox Code Playgroud)
我会先尝试这些...
如果您仍然发现问题,您可以使用以下命令检查 NIC 环形缓冲区ethtool -g
Ring parameters for eth0:
Pre-set maximums:
RX: 4096
RX Mini: 0
RX Jumbo: 0
TX: 4096
Current hardware settings:
RX: 256
RX Mini: 0
RX Jumbo: 0
TX: 256
Run Code Online (Sandbox Code Playgroud)
因此,您可以使用 .rx 将 rx 从 256 修改为 1024 ethtool -G eth0 rx 1024。