尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

centos虚拟机里面为何执行ethtool不显示速率?

centos虚拟机里面为何执行ethtool不显示速率? 最近蛮多类似询问虚拟机里面执行ethtool为何不显示速率但是windows却能显示速率为10Gbps。上图上图与物理主机不同在kvm虚拟化环境中ethtool仅返回了网口状态。来看看红帽的说明IssueHow do I check the network speed of avirtio-netnetwork interface?When a VM use virtio NICs,ethtoolis not workingWhy virtio network nic speed is 1G in subnetwork tab in RHEV Manager web interface ?ResolutionThis is expected, there is no set speed that avirtio-netinterface can operate at.The 1Gbps is just a placeholder because the driver has to report something.Root CauseTheres no set speed that avirtio-netinterface obtains. Its a software implementation of a network interface,it obtains the fastest possible speed it can, and that speed will vary depending on the network/CPU/memory load on the virtualization host at the time, as well the traffic.Consider that the emulatede1000network interfaces will report their speed as 1Gbps because they are a software emulation of a 1GbE interface. However, if you do traffic between two VMs on the same host using the emulatede1000interfaces, you will likely find you can exceed 1Gbps without a problem.If you emulate thise1000interface on a physical host with a 100Mbps network connection, then your guest will still say it has a 1-gigabit interface, but the maximum throughput attainable is 10% of that or less.Through all this,ethtoolwill still report the interface is operating at 1Gbps.The behavior of thevirtio-netinterfaces is the same, except the performance will be better because its para-virtualized instead of emulated, and it wont report speed inethtool.There is no way theethtoolprocess within a guest can possibly know the maximum speed that a givenvirtio-netinterface can obtain at any given time, so there is nothing forvirtio-netto report toethtool.总结下在kvm环境如果使用virtio_net驱动linux下不会显示速率会尽可能使用物理网络性能如果配置的是e1000网卡则会输出速率为1Gbps但这个显示不代表实际能达到的速率比如物理网络是100M在e1000场景也还是会显示1G。类似的在windows下。默认不支持virtio驱动需要安装驱动后才能支持其速率也是驱动层面设置而非实际的物理网络速率。
返回列表