Monday, March 11, 2019

Why HugePages?

HugePages is a feature integrated into the Linux kernel with release 2.6. This feature basically provides the alternative to the 4K page size (16K for IA64) providing bigger pages.

Using HugePages, the page size is increased to 2MB (configurable to 1G if supported by the hardware), thereby reducing the total number of pages to be managed by the kernel and therefore reducing the amount of memory required to hold the page table in memory.
  • HugePages can be allocated on-the-fly but they must be reserved during system startup. Otherwise the allocation might fail as the memory is already paged in 4K mostly.
  • HugePage sizes vary from 2MB to 256MB based on kernel version and HW architecture (See related section below.)
  • HugePages are not subject to reservation /  release after the system startup unless there is system administrator intervention, basically changing the hugepages configuration (i.e. number of pages available or pool size)

The Size of a HugePage

The size of a single HugePage varies according to:
  • Kernel version/linux distribution
  • HW Platform
The actual size of the HugePage on a specific system can be checked by:
      $ grep Hugepagesize /proc/meminfo

-->Following command to determine the current HugePage usage. The default HugePage size is 2MB on Oracle Linux 5.x and as you can see from the output below, by default no HugePages are defined.
        $ grep Huge /proc/meminfo
  1. Large Pages used by this instance (#pages) = HugePages_Total – HugePages_Free + HugePages_Rsvd
  2. (HugePages_Total- HugePages_Free)*2MB will be the approximate size of SGA
  3. Disable AMM (Automatic Memory Management)
  4. Check the MEMORY_TARGET parameters are not set for the database and SGA_TARGET and PGA_AGGREGATE_TARGET parameters are being used instead.
  5. If you are running Oracle 11.2.0.2 or later, you can set the USE_LARGE_PAGES initialization parameter to "only" so the database fails to start if it is not backed by HugePages.
Ref.
  • Huge Page Implementation Note 361468.1
  • Large Pages Information in the Alert Log Note: 1392543.1
  • Oracle Not Utilizing Hugepages (Doc ID 803238.1)
  • Shell Script to Calculate Values Recommended Linux HugePages / HugeTLB Configuration (Doc ID 401749.1)
  • USE_LARGE_PAGES To Enable HugePages (Doc ID 1392497.1)
  • Maximum SHMMAX values for Linux x86 and x86-64 (Doc ID 567506.1)
  • Upon startup of Linux database get ORA-27102: out of memory Linux-X86_64 Error: 28: No space left on device (Doc ID 301830.1)

No comments:

Post a Comment