phoxd
phoxd

Reputation: 1622

How to choose HugePage size

From what I understand we need an entry in a page table in order to access physical memory in RAM. So if I have 60TB of data in an Oracle database and 125GB RAM, what is the optimal size and number of HugePages?

Oracle docs [1] recommend allowing memlock to lock "at least 90 percent of current RAM".

If I allocate 1GB (1048576KB) page entry size, does it mean that I need to statically allocate 90% of 125GB as follows,

112 000 000 KB / 1 048 576 KB ~= 106 pages

Or for 2MB page entry,

112 000 000 KB / (2 MB * 1024 KB / 1MB) ~= 54687 pages

My biggest confusion is that if page table entries take up 90% of RAM where does an actual data go?

Upvotes: 0

Views: 1139

Answers (1)

EdStevens
EdStevens

Reputation: 3872

The size of the database is irrelevant. You want to configure enough hugepages to hold your SGA (or "all" of your SGAs if running multiple instance of Oracle on the same server). Probably the best calculator script (and the one I use) is My Oracle Support Doc ID 401749.1. Of course you have to have a paid support contract to get there. Lacking that, there is a script and description at https://oracle-base.com/articles/linux/configuring-huge-pages-for-oracle-on-linux-64. On review, I see that your cited doc also contains a script for recommendation of vm.nr_hugepages=value in /etc/sysctl.conf. All in all, I'd just with your cited doc, since you already have it. As far as your question of "where does the actual data go?" It goes on the disk. Until such time as it is read, in which case it goes into the data buffers in memory. Sounds like you need to review 'Instance Architecture' in the Concepts Manual.

Upvotes: 1

Related Questions