Huge Pages on Linux

SAP ASE supports huge pages for x64 and P-series Linux versions.

The CPU cache translation lookaside buffer (TLB) stores information about conversions from a virtual page address to the physical page address, and every byte access to physical memory requires a conversion (called a “cache miss”). Cache misses are expensive, but you can improve the TLB hits is by enabling “huge pages” on Linux machines.

Huge pages use fewer pages to cover the physical address space, so the size of “bookkeeping” (mapping from the virtual to the physical address) decreases, requiring fewer entries in the TLB and improving the system performance.

By default, SAP ASE versions 15.0.3 and later allocate shared memory using huge pages. However, if the system does not have enough huge pages—or is not configured for huge pages—SAP ASE uses regular pages, and writes this message to the error log:
Could not allocate memory using Huge Pages. Allocated using regular pages. For better performance, reboot the server after configuring enough Huge Pages

SAP ASE adjusts its shared memory up to the nearest multiple of 256MB. For example, if you configure SAP ASE with 800MB of shared memory, it is rounded off to 1GB (some versions of Linux do not allow you to allocate huge pages if the size is not a multiple of Hugepagesize).

Before starting SAP ASE, check /proc/meminfo to make sure Linux already has huge pages configured:
cat /proc/meminfo
HugePages_Total:    32
HugePages_Free:     32
Hugepagesize:    16384 kB
Note: Memory you allocate for huge pages is used only for the shared memory. Allocating too many huge pages may lead to SAP ASE excessively swapping physical pages. Allocate only the required number of huge pages.