Best Practices When Deploying Linux on the HP ProLiant DL980 (updated December 2012)

24
Test Hyper-Threading
Online Transaction Processing (OLTP) type Oracle database workloads typically perform better with Hyper-Threading
(HT) enabled. I/O-bound workloads have spare processing power and are not likely benefited by HT. HT is controlled by
the system BIOS and is enabled by default on the DL980. HP recommends that you test your workload with HT to make
sure HT actually helps overall performance.
Use HugePages
HugePages allow a processor to translate a virtual address range spanning multiple “base pages” with a single
Translation Look-aside Buffer (TLB) entry. Using HugePages can reduce TLB miss faults and the more costly page faults,
improving application performance for some workloads. The base page size on the x86_64 architecture is 4 KB and the
HugePage size is 2 MB or 512 base pages. HugePages can also reduce kernel page table overhead by requiring fewer
page table entries to map the same address space.
Because HugePages must be physically contiguous and aligned on the HugePage size boundary, they can be difficult to
allocate after the system has been running for some time and memory has become fragmented. Therefore, Linux
supports a pool of pre-allocated or “persistent” HugePages. You can populate the pool at boot time when available
HugePages are likely to be numerous, using the boot command line parameter hugepages=<nr_huge_pages>. You
can adjust the size of the pool at run time, subject to availability, using the sysctl command to modify the kernel
parameter vm.nr_hugepages.
System-wide HugePages statistics are found at /proc/meminfo. For example:
[root@tux ~]# grep Huge /proc/meminfo
HugePages_Total: 32768
HugePages_Free: 31350
HugePages_Rsvd: 19063
Hugepagesize: 2048 kB
Per-node HugePages statistics are found at /sys/devices/system/node/<node>/meminfo. For example:
[root@tux ~]# grep Huge /sys/devices/system/node/node*/meminfo
/sys/devices/system/node/node0/meminfo:Node 0 HugePages_Total: 4096
/sys/devices/system/node/node0/meminfo:Node 0 HugePages_Free: 3891
/sys/devices/system/node/node1/meminfo:Node 1 HugePages_Total: 4096
/sys/devices/system/node/node1/meminfo:Node 1 HugePages_Free: 3823
/sys/devices/system/node/node2/meminfo:Node 2 HugePages_Total: 4096
/sys/devices/system/node/node2/meminfo:Node 2 HugePages_Free: 3953
/sys/devices/system/node/node3/meminfo:Node 3 HugePages_Total: 4096
/sys/devices/system/node/node3/meminfo:Node 3 HugePages_Free: 3925
/sys/devices/system/node/node4/meminfo:Node 4 HugePages_Total: 4096
/sys/devices/system/node/node4/meminfo:Node 4 HugePages_Free: 3947
/sys/devices/system/node/node5/meminfo:Node 5 HugePages_Total: 4096
/sys/devices/system/node/node5/meminfo:Node 5 HugePages_Free: 3948
/sys/devices/system/node/node6/meminfo:Node 6 HugePages_Total: 4096
/sys/devices/system/node/node6/meminfo:Node 6 HugePages_Free: 3938
/sys/devices/system/node/node7/meminfo:Node 7 HugePages_Total: 4096
/sys/devices/system/node/node7/meminfo:Node 7 HugePages_Free: 3925
Oracle’s Automatic Memory Management (AMM) feature must be disabled for Oracle to make use of HugePages.
Disabling AMM requires setting the Oracle initialization parameter MEMORY_TARGET to zero and SGA_TARGET to the
desired Shared Global Area (SGA) size.
An Oracle database instance can be configured to use HugePages at startup by setting the initialization parameter
use_large_pages=ONLY. If sufficient HugePages are not available, the instance will not start and Oracle will return
the following error:
ORA-27102: out of memory
Oracle must also have sufficient privileges to lock the entire SGA in order to use HugePages:
[root@tux ~]# grep memlock /etc/security/limits.conf
# memlock - max locked-in-memory address space (KB)
oracle soft memlock <slightly larger than largest SGA>
oracle hard memlock <slightly larger than largest SGA>