Configuring Huge Pages In Red Hat Enterprise Linux 4 Or 5 - Red Hat ENTERPRISE LINUX 5.1 - LINUX ORACLE Tuning Manual

Oracle 9i and 10g tuning guide
Table of Contents

Advertisement

Configuring Huge Pages in Red Hat Enterprise Linux 4 or 5

This command usually takes a while to finish.
14.7. Configuring Huge Pages in Red Hat Enterprise Linux
4 or 5
Section 14.3, "Sizing Big Pages and Huge
Pages".
Before configuring Big Pages, ensure to have read
In Red Hat Enterprise Linux 4 or 5 the size of the Huge Pages pool is specified by the desired number
of Huge Pages. To calculate the number of Huge Pages you first need to know the Huge Page size. To
obtain the size of Huge Pages, execute the following command:
$ grep Hugepagesize /proc/meminfo
Hugepagesize:
2048 kB
$
The output shows that the size of a Huge Page on this system is 2MB. This means if a 1GB Huge
Pages pool should be allocated, then 512 Huge Pages need to be allocated. The number of Huge
Pages can be configured and activated by setting nr_hugepages in the proc file system. For
example, to allocate 512 Huge Pages, execute:
# echo 512 > /proc/sys/vm/nr_hugepages
Alternatively, you can use sysctl(8) to change it:
# sysctl -w vm.nr_hugepages=512
To make the change permanent, add the following line to the file /etc/sysctl.conf. This file is
used during the boot process. The Huge Pages pool is usually guaranteed if requested at boot time:
# echo "vm.nr_hugepages=512" >> /etc/sysctl.conf
If you allocate a large number of Huge Pages, the execution of the above commands can take a while.
To verify whether the kernel was able to allocate the requested number of Huge Pages, run:
$ grep HugePages_Total /proc/meminfo
HugePages_Total:
512
$
The output shows that 512 Huge Pages have been allocated. Since the size of Huge Pages is 2048
KB, a Huge Page pool of 1GB has been allocated and pinned in physical memory.
If HugePages_Total is lower than what was requested with nr_hugepages, then the system does
either not have enough memory or there are not enough physically contiguous free pages. In the latter
case the system needs to be rebooted which should give you a better chance of getting the memory.
To get the number of free Huge Pages on the system, execute:
$ grep HugePages_Free /proc/meminfo
Free system memory will automatically be decreased by the size of the Huge Pages pool allocation
regardless whether the pool is being used by an application like Oracle DB or not:
$ grep MemFree /proc/meminfo
45

Advertisement

Table of Contents
loading

Table of Contents