我有一个linux虚拟机与虚拟networking在kvm上运行,我想检查链接的速度。 我怎样才能做到这一点?
我到目前为止所尝试的是:
# ethtool eth0 Settings for eth0: Link detected: yes
看来ethtool不支持virtio-net(还有吗?)我有debian jessie的3.16-1版本,ethtool是否支持更新的版本? 它接缝版本6是最新的。
# cat /sys/class/net/eth0/speed cat: /sys/class/net/eth0/speed: Invalid argument # lspci | grep -iE --color 'network|ethernet' 00:12.0 Ethernet controller: Red Hat, Inc Virtio network device # lshw -class network *-network description: Ethernet interface product: Virtio network device vendor: Red Hat, Inc physical id: 12 bus info: pci@0000:00:12.0 logical name: eth0 version: 00 serial: 4e:ff:a8:bf:61:12 width: 32 bits clock: 33MHz capabilities: msix bus_master cap_list rom ethernet physical configuration: broadcast=yes driver=virtio_net driverversion=1.0.0 ip=172.30.2.152 latency=0 link=yes multicast=yes resources: irq:10 ioport:c080(size=32) memory:febf2000-febf2fff memory:febe0000-febeffff
我发现一个链接,描述在redhat kb中的问题,但不幸的是我没有订阅阅读。
Virtio是一个半虚拟驱动程序,这意味着操作系统和驱动程序知道它不是物理设备。 驱动程序实际上是guest虚拟机和pipe理程序之间的API,因此速度与任何物理设备或以太网标准完全断开。 这是一件好事,因为这比pipe理程序伪装成物理设备并且应用任意“链接速度”概念stream动的速度更快。 虚拟机只是将帧转储到总线上,这是处理物理设备的主机工作。 不需要虚拟机知道或关心主机物理设备的链路速度。
其中一个好处是,当数据包在同一台主机上的两台虚拟机之间移动时,它们可以像主机的CPU一样快地发送数据包,从而将数据从一组内存移动到外部,设置一个链接速度只需要一个不必要的速度限制。
这也允许主机进行适配器分组,并将stream量分布在多个链路上,而不需要每个虚拟机都需要明确configuration以获得设置的全部带宽。
如果您想知道如何将数据从虚拟机传输到其他位置,您需要使用iperf工具进行实际吞吐量testing
Cumulus Networks公司已经将他们的补丁升级到了virtio_net驱动。 它在Cumulus VX VM产品的networking仿真中非常有用。
修补程序在Ubuntu Xenial中。 不知道今天是否在Fedora中。
更多详细信息可以在这里find。 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1581132
另一个参考是我的博客文章,为什么在virtio驱动程序的速度设置是有用的。