linux-千兆网口测速只有百兆

linux-千兆网口测速只有百兆,第1张

linux-千兆网口测速只有百兆

千兆网口测速只有百兆
现象:
使用iperf测速,千兆网口带宽只有7Mbis/s
原因:
通过ethtool --show-offload 网口名,查看网卡的配置。
发现没有关闭gso、tso、gro,导致的问题,为什么要关闭它们:

关闭gso: 大数据一次发送,不分片,提高效率
关闭tso: tso将利用网卡进行数据分片,由于网卡性能低,导致传输效率低,关闭它,则使用cpu进行数据分片。
关闭gro:gro会将多个tcp包数据聚合成一个大的数据包,然后传递给网络协议栈处理,本网卡聚合较费时间,因此关闭它

执行如下,重新配置网卡:

sudo bash -c "cat > /etc/network/if-pre-up.d/ethtool-tso </dev/null 2>&1
/sbin/ethtool -K eth1 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth2 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth3 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth4 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth5 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth6 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth7 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth8 tso off gso off gro off >/dev/null 2>&1
/sbin/ethtool -K eth9 tso off gso off gro off >/dev/null 2>&1
exit 0
EOF"

执行 /etc/network/if-pre-up.d/ethtool-tso即可

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5605181.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存