Re: Maximize Number of Instances on RHEL 7.9

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Sat, 7 Oct 2023 14:16:13 -0400
Message-ID: <ce3ee12f-0453-4b88-bd59-3716184e0ff1_at_gmail.com>



On 10/7/23 12:40, Jared Still wrote:
> One of the things I am curious about is why no hugepages?
>
> I'm not aware of hugepages being non-useful due to small SGA size.
>
> With so many instances I would think it rather a good feature to employ.
>
>
Well, let's clarify. Huge pages are usually neither swapped out nor paged out. Swapping out and paging out are two different processes which can be very expensive. Both processes include I/O requests and waiting for the process to complete. Second, huge pages are usually 2 GB in size (we're talking Linux x86_64) which means that the page table indexing the shared segment needs one entry per 2GB page. Without huge pages, page table need one entry per 4KB. In other words, huge pages can save quite a bit of memory as the page tables indexing huge pages are 524288 times smaller than the page tables comprised of 4KB pages. Of course, if the SGA is small, savings are a lot smaller, but they still do exist.

Please, do not forget that huge pages are allocated on system startup and cannot be used for small pages memory. If you allocate 16GB of pages for Oracle, you cannot use it for other, more useful stuff, like Diablo4 or GTA5. There is a variety of huge pages, called "transparrent huge pages", but Oracle cannot use them. As a matter of fact, it is advised to disable transparent huge pages with Oracle because they were causing Linux crashes. That is the info from RHEL7. I am not sure about RHEL8 or RHEL9 but I still disable them with the following commands:

    if test -f /sys/kernel/mm/transparent_hugepage/enabled; then         echo never > /sys/kernel/mm/transparent_hugepage/enabled     fi
    if test -f /sys/kernel/mm/transparent_hugepage/defrag; then         echo never > /sys/kernel/mm/transparent_hugepage/defrag     fi

I was a VAX/VMS system administrator before I became an Oracle DBA. VAX/VMS was very meticulous about the memory parameters and one could tune the memory usage quite precisely. Linux is not as good. However, huge pages are a good feature, inspired by the VIRTUAL=REAL memory on the MVS mainframes. Memory tuning on Linux is still somewhat esoteric discipline, not frequently practiced these days. BSD Unix varieties have much more configurable memory parameters but, unfortunately, nobody is using BSD, ever since the demise of Slowaris 4.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Oct 07 2023 - 20:16:13 CEST

Original text of this message