6.2. Disabling vhost-net
vhost-netmodule is a kernel-level back end for virtio networking that reduces virtualization overhead by moving virtio packet processing tasks out of user space (the QEMU process) and into the kernel (the
vhost-netdriver). vhost-net is only available for virtio network interfaces. If the vhost-net kernel module is loaded, it is enabled by default for all virtio interfaces, but can be disabled in the interface configuration if a particular workload experiences a degradation in performance when vhost-net is in use.
Specifically, when UDP traffic is sent from a host machine to a guest virtual machine on that host, performance degradation can occur if the guest virtual machine processes incoming data at a rate slower than the host machine sends it. In this situation, enabling
vhost-netcauses the UDP socket's receive buffer to overflow more quickly, which results in greater packet loss. It is therefore better to disable
vhost-netin this situation to slow the traffic, and improve overall performance.
vhost-net, edit the
<interface>sub-element in the guest virtual machine's XML configuration file and define the network as follows:
<interface type="network"> ... <model type="virtio"/> <driver name="qemu"/> ... </interface>
Setting the driver name to
qemuforces packet processing into QEMU user space, effectively disabling vhost-net for that interface.