linux下网卡buffer size修改



在网上找一些文章,是因为网卡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-ring  www.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
几个小时后,已经没有丢包增加的情况了
 

相关内容

    暂无相关文章