DEV Community

Cover image for Proxmox Virtual Machine optimization
Serge Logvinov
Serge Logvinov

Posted on

Proxmox Virtual Machine optimization

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

Common optimizations

CPU Settings

CPU Type

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

CPU Affinity

Set dedicated CPU by setting CPU affinity for the VM. This setting will prevent the VM from using other CPUs.

Turn on NUMA (Non-Uniform Memory Access) for better memory handling on large servers. Choose the right CPU cores in one NUMA node.

More details

Memory Settings

Memory Huge Pages

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

More details

Network Configuration

Use VirtIO Network Driver

Always use VirtIO drivers for network cards. VirtIO drivers are paravirtualized drivers for network and disk devices. They are faster than the default drivers. Enable Multiqueue queues the same as the number of CPU cores.

Enable Jumbo Frames

Allow Jumbo Frames for larger network packets. You can enable Jumbo Frames in Proxmox by setting the MTU (Maximum Transmission Unit) value to 9000 on the network interface configuration.

SR-IOV

Use Single Root I/O Virtualization (SR-IOV) for better network performance. SR-IOV allows a single physical network card to appear as multiple virtual network cards. After enabling SR-IOV, you can assign a virtual function to the VM. VM will have direct access to the physical network card. The Hypervisor will not be involved in network processing.

More details

Disk Storage Type

The disk storage type is one of the most important factors for VM performance.
Local storage is faster than network storage. SSD is faster than HDD.
LVM (not a thin) is faster than ZFS. ZFS is faster than NFS.

For the safety of your data, use the soft RAID 1 or 10 for the local storage.

  • for 2 disks use RAID 1 with mdraid implementation
  • for 4 disks or more try to use ZFS

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

Use VirtIO/SCSI VirtIO drivers

Always use VirtIO drivers for disk devices. VirtIO drivers are paravirtualized drivers for disk devices. They are faster than the default drivers.

SR-IOV

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

Top comments (1)

Collapse
 
carlos_thompson_802151972 profile image
Carlos Thompson

I appreciate your perceptive piece on Proxmox Virtual Machine optimisation. For both novice and experienced managers, your thorough analysis of CPU, memory, network, and storage policies is a priceless tool. Especially when live migration isn't necessary, the focus on choosing the CPU type to "host" and selecting CPU affinity fits best practices for optimising performance. Another important feature is allowing NUMA for big servers to provide effective memory management among many nodes.

Your analysis of memory settings—especially the utilisation of large pages—highlights a sometimes neglected area that may seriously affect virtual machine performance. Larger chunk memory allocation lowers overhead and speeds access, therefore benefiting highly sought-after programmes.

Regarding network architecture, supporting VirtIO drivers and allowing Jumbo Frames shows that one clearly knows how to improve throughput and lower latency. The reference to SR-IOV for storage and network devices emphasises even more the possibility of near-native performance made possible by VMs direct access to actual hardware. To delve deeper into the benefits of our Best Mini PC for Proxmox and discover why it's the perfect solution for you, click this link to access more information.