Re: Some more hugepages questions/thoughts
Date: Thu, 02 May 2013 21:04:47 +1000
Message-ID: <5182484F.3050300_at_iinet.net.au>
Just a word of caution, Chris. Read it more as a heads up than as "pending doom"!
Hugepages necessitate that the software using them aligns memory allocations on a page boundary, under penalty of grossly wasting memory. In C/C++, there is a specific syntax to do that when using malloc() and other such. Look up shmalloc and you will see some examples.
Now, Oracle doesn't do this alignment ad-hoc. It assumes that if you want to use hugepages - in Linux - then it'll align to pre-defined values. These vary from OS to OS. In Linux it's fairly relaxed. But in Aix it's better to use 16MB pagesize until Aix 7.1 and Oracle 11r2.
Quite a lot of good info and good links in Tim Hall's site: http://www.oracle-base.com/articles/linux/configuring-huge-pages-for-oracle-on-linux-64.php
And try to not mix sizes of hugepages in the same system. Stick to one value. Not always possible - eg, Aix uses 64K pages for portions of the OS in release 7 onwards - but it doesn't hurt to not go overboard.
I'm a bit spoiled by Aix as there it is possible to use largepages only for SGA, leaving the Oracle processes untouched. Or to allocate it also to processes. Or any mix in between. And the total amount can be dynamically varied without a reboot. But in other OS types things are not that easy and it pays to think about how to allocate the memory. Which you are doing and all credit for it!
-- Cheers Nuno Souto dbvision_at_iinet.net.au On 2/05/2013 3:45 AM, Christopher.Taylor2_at_parallon.net wrote:Received on Thu May 02 2013 - 13:04:47 CEST
> I'm just now beginning to work through the hugepages configuration on Linux 5.8 64-bit, running Oracle 10.2.0.4.
> Dev and QA are both 3 node RAC systems running 4 separate databases in each environment. (So node1 of each environment has 4 instances)
> Prod has 1 database across 3 nodes (1 instance on each node)
>
> If I wanted to follow the 80-20 rule (80% of memory for SGA, 20% for PGA/System Processes), could I just configure huge page pool (vm.nr_hugepages) derived from the 80% number? (As opposed to running the shell script provided by metalink to give me an accurate number for vm.nr_hugepages).
>
> The reason I ask this question is that the number of sessions/processes connected varies widely during day/night cycles and the workload is much different.
>
> I'm trying to keep this simple (and perhaps I'm already overthinking it) but it seems if I allocated roughly 80% of total memory to hugepages then I could fit all my databases inside that pool as needed and practically never worry about the system memory being overallocated (as long as I size my Oracle pools correctly for each instance).
>
> I was also under the impression that you could set the pagesize 2MB, 4MB etc on Linux like you can on AIX - wouldn't that affect the vm.nr_hugepages figure that is used?
>
> So, if I wanted to do this, how could I back my way into the vm.nr_hugepages starting from 128GB system memory:
>
> 128GB * 0.80 = 102.4 GB
> ASM uses roughly 500MB - so now I have 101.9 GB.
>
> So to be safe, let's use 101 GB as the available system memory I want to allocate to hugepages.
>
> How do I back into the nr_hugepages from here?
>
>
-- http://www.freelists.org/webpage/oracle-l