Enabling Huge Page Memory
Enabling huge page memory minimizes page table hierarchy levels for memory access and reduces TLB misses, which substantially lowers memory management overhead during network protocol stack operations. This optimization results in improved network throughput and reduced latency.
- Modify the kernel cmdline startup parameters.The following method adds the target huge page size and quantity to the startup parameters, enabling huge pages permanently.
1vim /etc/grub2-efi.cfgAdd default_hugepagesz=2M hugepagesz=2M hugepages=50000 to the kernel cmdline. As shown in the following figure, the default huge page size is 2 MB and the number of huge pages is 50,000. Restart the server.

- Check the huge page configuration.
1cat /proc/sys/vm/nr_hugepages
- Configure huge pages in the VM XML file.
1virsh edit <VM_name>
Specify the size in page size, that is, the size of the huge page memory enabled for the VM.1 2 3 4 5 6 7 8 9
<domain type = 'KVM'> ... <memoryBacking> <hugepages> <page size='2048' unit='KiB'/> </hugepages> </memoryBacking> ... <domain>
Parent topic: Network Loss Optimization