To setup HugePages, the following changes must be
completed:
- Set the
vm.nr_hugepages kernel
parameter to a suitable value. In this case, we
decided to use 12GB and set the parameter to
6144 (6144*2M=12GB). You can run:
echo 6144 > /proc/sys/vm/nr_hugepages
or
sysctl -w vm.nr_hugepages=6144
Of course, you must make sure this set across
reboots too.
- The
oracle userid needs to be
able to lock a greater amount of memory. So,
/etc/securities/limits.conf must be
updated to increase soft and hard memlock values
for oracle userid.
oracle soft memlock 12582912
oracle hard memlock 12582912
After setting this up, we need to make sure that
SGA is indeed using HugePages. The value, (HugePages_Total-
HugePages_Free)*2MB will be the approximate
size of SGA (or it will equal the shared memory
segment shown in the output of ipcs -ma).
cat /proc/meminfo |grep HugePages
HugePages_Total: 6144
HugePages_Free: 1655 <-- Free pages are less than total pages.
Hugepagesize: 2048 kB