Optimize Proxmox VE for maximum performance through CPU pinning, memory management, and NUMA configuration.
CPU Pinning
What is CPU Pinning
CPU pinning binds VM vCPUs to specific physical CPU cores, reducing context switching overhead.
Pin VM to Cores
# Pin to cores 0-3qm set 100 --cores 4 --cpuset 0-3# Pin to cores 0,2,4,6 (even cores)qm set 100 --cpuset 0,2,4,6# Pin specific coresqm set 100 --cpulimit 2 --cpuunits 1024
Options Explained
Option
Description
—cores
Number of vCPUs
—cpuset
Physical cores to use
—cpulimit
CPU limit (%)
—cpuunits
CPU weight (0-1024)
Multi-Socket NUMA
# Enable NUMAqm set 100 --numa 1# Configure NUMA nodeqm set 100 --numa0 memory=4096,cpus=0-3# Second NUMA nodeqm set 100 --numa1 memory=4096,cpus=4-7
Huge Pages
Enable Huge Pages
# Enable 2MB huge pagesqm set 100 --hugepages 1024# Enable 1GB huge pagesqm set 100 --hugepages 1# Check current huge pagescat /proc/meminfo | grep -i huge
# Disable balloon (for performance VMs)qm set 100 --balloon 0# Set minimum balloonqm set 100 --balloon 4096# Configure balloon drivers in guest# Linux: apt install pciutils# Windows: Install balloon driver
Memory Locking
# Lock memory (prevent swap)qm set 100 --lockmemory 1# Check memory in guestcat /sys/kernel/mm/transparent_hugepage/enabled
NUMA Memory
# Enable NUMAqm set 100 --numa 1# Auto NUMAqm set 100 --numa auto=1
I/O Optimization
I/O Thread
# Enable I/O threadqm set 100 --iothread 1# Add to VirtIO diskqm set 100 --scsi0 local:,iothread=1,discard=1,ssd=1
VirtIO Drivers
# Optimal VirtIO configqm set 100 --scsi0 local:,cache=none,iothread=1# Enable discardqm set 100 --scsi0 local:,discard=1# SSD emulationqm set 100 --scsi0 local:,ssd=1
Disk Options
Option
Description
cache=none
No host cache
cache=writeback
Write back
discard=1
TRIM support
ssd=1
SSD emulation
iothread=1
I/O thread
Network Optimization
VirtIO Multi-Queue
# Enable multi-queue (4 queues)qm set 100 --net0 virtio,bridge=vmbr0,queues=4# Update running VMqm set 100 --net0 virtio,bridge=vmbr0, queues=8# Maximum 16 queues
Network Options
Option
Description
queues=N
Number of queues
rx=N
RX queues
tx=N
TX queues
Packet Steering
# RSS configuration in guestethtool -L eth0 combined 4
CPU Mode Optimization
Host CPU Mode
# Use host CPU (best performance)qm set 100 --cpu host# Enable flagsqm set 100 --cpu host --flags +vmx,+svm# Specific CPU typeqm set 100 --cpu Penrynqm set 100 --cpu Haswell-noTSX
CPU Flags
Flag
Description
+vmx
Intel VT-x
+svm
AMD-V
+aes
AES-NI
+avx
AVX
+avx2
AVX2
Real-Time Performance
Enable Real-Time
# Configure real-timeqm set 100 --realtime 1# Set CPU maskqm set 100 --cpumask 0-3