Question
Virtual machines (VMs) running Windows OS exhibit low disk performance. This issue does not occur on Linux VMs.
How can disk performance be increased in Windows VMs?
Answer
You can improve performance by configuring I/O processing threads (iothreads). When all disks of a VM are handled by a single thread, a performance bottleneck occurs under high load. Configuring iothreads distributes disk load across multiple threads, thereby increasing performance.
Preparation
Before configuring iothreads, ensure that the latest VirtIO drivers (Balloon, NetKVM, Viostor) are installed on the Windows VM. Missing or outdated drivers are the most common cause of low performance. These drivers are not installed by default on Windows and must be installed separately. Configuring iothreads will not yield significant improvements without proper VirtIO drivers.
Configuring iothreads
To resolve the issue, configure iothreads:
- Stop the VM: navigate to Virtual Machines → Menu
→ Stop. - Connect to the cluster node via SSH. For more information about connecting via SSH, see Workstation setup.
- Identify the internal name of the target VM:
virsh list --all | grep <VM_name>Example outputvirsh list --all | grep testtest 460 5450_testtest runningComment:
testtest— VM name;5450_testtest— internal VM name.
-
Open the VM configuration:
WarningIncorrectly modifying the configuration may render the VM inoperable. It is recommended to create a backup of the configuration before editing.virsh edit <internal_VM_name> - Apply the following changes to the configuration:
- After the
<vcpu>block, add the<iothreads>element with the desired number of threads. This number must not exceed the number of VM CPU cores.
Comment:Example of iothreads configuration<vcpu placement='static'>4</vcpu> <iothreads>2</iothreads>4— number of VM cores;2— number of iothreads.
- Assign threads to disks. In each disk section, add
iothread='N', where N is the thread number. Distribute thread numbers based on the load of each disk.Example of assigning an iothread to a disk<driver name='qemu' type='qcow2' cache='none' io='native' iothread='1'/>Comment:
- 1 — thread number assigned to the disk.
- After the
- Save the configuration.
Additional performance tuning
In QEMU versions prior to 9.0, only one thread can be assigned to a single disk. To further increase performance (especially for NVMe storage), enable multi-queuing using the queues parameter.
- Open the VM configuration:
WarningIncorrectly modifying the configuration may render the VM inoperable. It is recommended to create a backup of the configuration before editing.virsh edit <internal_VM_name> - Add the
queues='2'parameter:
Comment:Example of enabling multi-queue<driver name='qemu' type='qcow2' cache='none' io='native' iothread='1' queues='2'/>queues='2'— number of processing queues. This allows the guest OS to send I/O requests in parallel and reduces lock contention in the driver. Related topics:
En
Es