Proxmox Virtual machine optimization – DEV Community
December 23, 2024

Proxmox Virtual machine optimization – DEV Community

Proxmox Virtual Environment (VE) is a powerful open source virtualization platform for managing virtual machines (VMs). To make your virtual machines run faster, you need to set them up correctly.


CPU type

If you do not want to use live migration, you need to set the CPU type to host. This setting allows the virtual machine to use all the features of the physical CPU but completely disables live migration, which may not be suitable for all environments.


CPU affinity

Configure a dedicated CPU by setting the VM’s CPU affinity. This setting will prevent the VM from using other CPUs.

Turn on NUMA (Non-Uniform Memory Access) to better handle memory on large servers. Select the correct CPU core in a NUMA node.

More details


huge pages of memory

Consider using huge pages for better memory performance. Large pages are larger than ordinary pages and can improve memory access speed. It allocates memory in 2MB or 1GB chunks, making the boot process dry. And this memory is reserved only for the VM, and the virtual machine hypervisor cannot use it.

More details


Using the VirtIO network driver

Always use the VirtIO driver for the network card. The VirtIO driver is a paravirtualized driver for network and disk devices. They are faster than the default drivers. Enable Multiqueue queues with the same number of CPU cores.


Enable jumbo frames

Allows jumbo frames to be used for larger network packets. You can enable jumbo frames in Proxmox by setting the MTU (Maximum Transmission Unit) value to 9000 in the network interface configuration.


SR-IOV

Use Single I/O Virtualization (SR-IOV) for better network performance. SR-IOV allows a single physical NIC to appear as multiple virtual NICs. After enabling R-IOV, you can assign virtual functions to the VM. The VM will have direct access to the physical network card. The hypervisor will not participate in network processing.

More details

Disk storage type is one of the most important factors affecting virtual machine performance.
Local storage is faster than network storage. SSD is faster than HDD.
LVM (not thin) is faster than ZFS. ZFS is faster than NFS.

For data security, please use software RAID 1 or 10 for local storage.

  • For 2 disks, use RAID 1 and mdraid implementation
  • For 4 or more disks try using ZFS

The LVM backend is faster than other backends for local storage.
The ZFS backend works better on large storage, but it requires more memory and CPU.


Using the VirtIO/SCSI VirtIO driver

Always use the VirtIO driver for disk devices. The VirtIO driver is a paravirtualized driver for disk devices. They are faster than the default drivers.


SR-IOV

For huge storage performance, SR-IOV can be used for disk devices. You can assign NVME directly to the VM. The virtual machine will have direct access to the physical disk, and this performance will be the same as on the host machine.

2024-12-23 05:26:50

Leave a Reply

Your email address will not be published. Required fields are marked *