How do I set up hugepages in RHEL?

Hugepages can be allocated using the /proc/sys/vm/nr_hugepages entry, or by using the sysctl command. To view the current setting using the /proc entry:
# cat /proc/sys/vm/nr_hugepages
0

To view the current setting using the sysctl command:
# sysctl vm.nr_hugepages
vm.nr_hugepages = 0

To set the number of huge pages using /proc entry:
# echo 5 > /proc/sys/vm/nr_hugepages

To set the number of hugepages using sysctl :
# sysctl -w vm.nr_hugepages=5
vm.nr_hugepages = 5

It may be necessary to reboot to be able to allocate all the hugepages that is needed. This is because hugepages requires large areas of contiguous physical memory. Over time, physical memory may be mapped and allocated to pages, thus the physical memory can become fragmented.
If the hugepages are allocated early in the boot process, fragmentation is unlikely to have occurred.

It is recommended that the /etc/sysctl.conf file should be used to allocate hugepages at boot time. For example, to allocate 5 hugepages at boot time add the line below to the sysctl.conf file:
vm.nr_hugepages = 5

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

© 2014 Admon Linux. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by DigitalOcean