admin 发表于 2018-8-26 00:53:51

CentOS系统网卡buffer size过小导致错报error增长问题的解决方法

如果是10G端口,首先检查光模块是否有问题,可以通过排除法来排查。如果确定问题出在操作系统内部并非光模块问题,可以尝试如下方法能否修改问题。

在网上查看了一些文章,怀疑是因为网卡buffer size太小导致(This is a count of packets that have been dropped by the kernel, either due to a firewall configuration or due to a lack of network buffers.)。那我们就只有调整网卡buffersize,找了一些国外的文章,可以通过ethtool来修改网卡的buffer size ,首先要网卡支持,由于是NAT设备,我的全部是INTEL 的1000M网卡。

我们看看ethtool说明
-g –show-ringwww.2cto.com
Queries the specified ethernet device for rx/tx ring parameter information.
-G –set-ring
Changes the rx/tx ring parameters of the specified ethernet device.
   
查看当前网卡的buffer size情况
ethtool -g eth0
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
   
由于我的是rx包会有droped的情况
我们用www.2cto.com
ethtool -G eth0 rx 2048
同样 对于eth1也是如此
ethtool -G eth1 rx 2048
再看看修改过后的
ethtool -g eth0
Ring parameters for eth0:
Pre-set maximums:
RX:             4096
RX Mini:      0
RX Jumbo:       0
TX:             4096
Current hardware settings:
RX:             2048
RX Mini:      0
RX Jumbo:       0
TX:             2048

经过几个小时的观察,目前已经没有丢包增加的情况了。
页: [1]
查看完整版本: CentOS系统网卡buffer size过小导致错报error增长问题的解决方法