Category: OS

Configuring Hugepages

The following are the advantages of using HugePages:

  • Increased performance through increased TLB hits.
  • Pages are locked in memory and are never swapped out which guarantees that shared memory like SGA remains in RAM.
  • Contiguous pages are preallocated and cannot be used for anything else but for System V shared memory (for example, SGA)
  • Less bookkeeping work for the kernel for that part of virtual memory due to larger page sizes
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk {'print $2'}`

SEG_BYTES=`ipcs -m | awk {'print $5'} | grep "[0-9][0-9]*"`

The >> ipcs -m : Show only shared memory

echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q

echo "$NUM_PG+$MIN_PG+1" | bc -q

Value of memlock (both soft and hard) in /etc/security/limits.conf
* soft memlock
* hard memlock

is HugePages allocation in KB based on calculation :
ie. HugePages * Hugepagesize * 1024

Value of vm.nr_hugepages

Reference :