Configuring Huge Pages in Red Hat Enterprise Linux 4 or 5
45
This command usually takes a while to finish.
14.7. Configuring Huge Pages in Red Hat Enterprise Linux
4 or 5
Before configuring Big Pages, ensure to have read
Section 14.3, “Sizing Big Pages and Huge Pages”
.
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
Summary of Contents for CLUSTER SUITE FOR ENTERPRISE LINUX 5.1
Page 7: ...Part I Tuning and Optimizing Red Hat Enterprise Linux for Oracle Database 9i and 10g ...
Page 8: ......
Page 10: ...4 ...
Page 16: ...10 ...
Page 28: ...22 ...
Page 30: ...24 ...
Page 36: ...30 ...
Page 42: ...36 ...
Page 54: ...48 ...
Page 60: ...54 ...
Page 68: ...62 ...
Page 72: ...66 ...
Page 88: ...82 ...
Page 90: ...84 ...
Page 92: ...86 ...
Page 94: ...88 ...
Page 98: ...92 ...
Page 108: ...102 ...
Page 112: ...106 ...
Page 120: ...114 ...
Page 122: ......
Page 128: ...122 ...
Page 132: ...126 ...
Page 134: ...128 ...
Page 142: ...136 ...
Page 146: ...140 ...
Page 156: ...150 ...
Page 160: ...154 ...