18.7. Optimizing virtual machine network performance


Due to the virtual nature of a VM’s network interface controller (NIC), the VM loses a portion of its allocated host network bandwidth, which can reduce the overall workload efficiency of the VM. You can minimize the negative impact of virtualization on the virtual NIC (vNIC) throughput by modifying the VM’s configuration.

Procedure

  • Use any of the following methods and observe if it has a beneficial effect on your VM network performance:

    • Enable the vhost_net module

      On the host, ensure the vhost_net kernel feature is enabled:

      # lsmod | grep vhost
      vhost_net              32768  1
      vhost                  53248  1 vhost_net
      tap                    24576  1 vhost_net
      tun                    57344  6 vhost_net

      If the output of this command is blank, enable the vhost_net kernel module:

      # modprobe vhost_net
  • Set up multi-queue virtio-net

    To set up the multi-queue virtio-net feature for a VM, use the virsh edit command to edit to the XML configuration of the VM. In the XML, add the following to the <devices> section, and replace N with the number of vCPUs in the VM, up to 16:

    <interface type='network'>
          <source network='default'/>
          <model type='virtio'/>
          <driver name='vhost' queues='N'/>
    </interface>

    If the VM is running, restart it for the changes to take effect.

    • Batching network packets

      In Linux VM configurations with a long transmission path, batching packets before submitting them to the kernel may improve cache utilization. To set up packet batching, use the following command on the host, and replace tap0 with the name of the network interface that the VMs use:

      # ethtool -C tap0 rx-frames 64
    • SR-IOV

      If your host NIC supports SR-IOV, use SR-IOV device assignment for your vNICs.

      For more information, see Managing SR-IOV devices.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部