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.
- Open the grub2-efi.cfg file.
vim /etc/grub2-efi.cfg
- Press i to enter the insert mode and add default_hugepagesz=2M hugepagesz=2M hugepages=50000 to cmdline. As shown in the following figure, the default huge page size is 2 MB and the number of huge pages is 50,000.

- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Run the reboot command to reboot the server.
- Open the grub2-efi.cfg file.
- 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