HugePages and Oracle RAC

 HugePages and Oracle RAC

  • HugePages is a feature integrated into the Linux kernel with release 2.6. This feature basically provides the alternative to the 4K page size providing bigger pages.
  • HugePage sizes vary from 2MB to 256MB based on kernel version and H/W architecture.

 Why HugePages Should Be Used on RAC with 64-bit Linux?

  • Very Large Memory: The 64-bit systems do have VLM. So the general VLM issues apply.
  • Not swappable: HugePages are not swappable. Therefore there is no page replacement mechanism overhead.HugePages are universally regarded as pinned.

To check whether HugePages are supported/available on a running configuration, run:
$ grep Huge /proc/meminfo

and check the output:

HugePages_Total:
HugePages_Free:
Hugepagesize:

To check the HugePages value set, run:

$ sysctl -a|grep vm.nr_hugepages

and check the output:

vm.nr_hugepages = 4000

This value can be anything as per your architecture.

To calculate HugePages, here is the formula:

vm.nr_hugepages = ((1+3%)*SGA_SIZE)/2MB

Case Study – RAC with 32 GB memory

This is a simple case study narrated to understand how huge page is helpful for RAC, or even in non RAC [HugePage setup is very common in RAC rather stand alone].

Lets look at a architecture where 32 GB memory used in a 4*32 architecture, we set HugePages as 7200, and see how memory allocation happens for this architecture.

Since HugePage sizes vary from 2MB to 256MB based on kernel version, here lets assume HugePage size is 2MB, so memory allocation would be:

7200 * 2 = 14400  i.e ~ 14 GB

So in this case out of 32 GB memory, regardless of anything 14 will be allocated for VLM. During RDBMS kernel start up, that will intern look if HugePages enabled or not, and if enabled this 14 GB memory will be logicaly reserved for SGA [Remember always SGA size should be less than HugePage memory]. Which means, no other process will touch this 14GB allocated memory overhead to Oracle process can be eliminated and attain maximum performance.

Reference: Note 361323.1

About the Author Atul Kumar

Leave a Comment:

1 comments
polarbear says November 10, 2011

Hello,

Hugepages with VLM on Linux will benefit only shared pool and large pool. NOT buffer cache.

Reply
Add Your Reply

Not found