7 Replies Latest reply: Jun 10, 2014 2:03 AM by Dude! RSS

    Transparent Huge Pages - Is there a need to disable them?

    user632098

      I am using OEL 6.3.4 (?) running Oracle 11g r2 11.2.0.4. Page size is 2M by default. I have set to use large huge pages and I can verify that they are being used by looking at alert logs and in /proc/meminfo and my sga is all in large huge pages.

       

      My question is about transparent  huge pages instead. Oracle has a metal ink note which says to disable them:

      https://support.oracle.com/epmos/faces/Registration?_adf.ctrl-state=1txlnfyh8_4&_afrLoop=33725260239640

       

      I am not using RAC. My Linux Server not only has Oracle database installed, but also many java programs of my applications. Transparent huge pages were developed so various java programs can take advantage of them without making any changes to application.

      Therefore, is it necessary to disable them?

       

      Even when I disabled them following instructions in metal ink article, I see they are still being used by Oracle db writer and arch processes? Googling shows others also find that these Oracle processes use annon  huge pages memory; so transparent huge pages are “not getting disabled”

       

      Appreciate your insight.

        • 1. Re: Transparent Huge Pages - Is there a need to disable them?
          Dude!

          What exactly have you done to disable TPH?

           

          Transparent hugepages are not used for Oracle SGA, but other programs can take advantage of it. I read that it can be a 10 % performance advantage using TPH compared to standard memory pages. Efficiency of course all depends on memory usage. If the primary use of the system is Oracle Database than performance aspects of other software might be secondary and following Oracle's recommendation should be more reasonable.

          • 2. Re: Transparent Huge Pages - Is there a need to disable them?
            user632098

            Alternatively, add the following lines into the "/etc/rc.local" file and reboot the server.

            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

            Whichever method you choose, remember to check the change has work after reboot.

            # cat /sys/kernel/mm/transparent_hugepage/enabled  always madvise [never]  #

             

            I have done and verified as per above. Yet, I see AnonHugePages are being used by dbwr and arc processes.

            • 3. Re: Transparent Huge Pages - Is there a need to disable them?
              Dude!

              You may have to verify that rc.local is actually being executed. However, I wouldn't be sure if this will actually disable THP support for already running processes. The Oracle database is probably started before rc.lcoal comes into play.

               

              I would rather suggest to disable THP using a kernel parameter that gets set when the kernel is loaded. You can add the following to the kernel parameter line in the startup menu or permanently adding it in your grub.conf file:

               

              transparent_hugepage=never

              • 4. Re: Transparent Huge Pages - Is there a need to disable them?
                user632098

                I had alreday tried that.

                 

                My original quetsion is why it is ncessary t disbale tranparent hugh pages. If transparent huge pages are disabled, won't various java programs run slower. I can verify that Oracle's sga is in large pages. If they are then tranparent huge pages will not hurt sga. at the same time they can be used by other java applications.

                • 5. Re: Transparent Huge Pages - Is there a need to disable them?
                  Dude!

                  Programs don't necessarily run slower with THP turned off. It depends on memory use and how efficient the kernel can work with the limited TLB cache, for instance. This is a question about understanding how hugepages work and where the advantage comes from. THP is similar to standard hugepages, but can be swapped, allocation is dynamic, and last not least it is private memory.

                   

                  According to http://www.oracle.com/technetwork/articles/servers-storage-dev/hugepages-2099009.html#trans

                   

                  Transparent HugePages and Oracle Databases


                  Recently, in RHEL 6, Oracle Linux 6, and SUSE Linux Enterprise Server 11 a new feature, transparent HugePages was introduced. Transparent HugePages is an attempt to make the use of HugePages automatic and dynamic. Unfortunately the use of transparent HugePages in conjunction with the use of traditional HugePages is currently causing problems that can result in performance issues and system reboots. In My Oracle Support note 1557478.1, Oracle recommends not using transparent HugePages in conjunction with Oracle databases.


                  Note: In Oracle Linux version 6.5 Transparent HugePages have been removed.

                   

                  Most servers today are fixed purpose and implementation is often 3-tier. As such, to disable THP for the database server makes sense.

                  • 6. Re: Transparent Huge Pages - Is there a need to disable them?
                    user632098

                    >> Recently, in RHEL 6, Oracle Linux 6, and SUSE Linux Enterprise Server 11 a new feature, transparent HugePages was introduced. Transparent HugePages is an attempt to make the use of HugePages automatic and dynamic. Unfortunately the use of transparent HugePages in conjunction with the use of traditional HugePages is currently causing problems that can result in performance issues and system reboots. In My Oracle Support note 1557478.1, Oracle recommends not using transparent HugePages in conjunction with Oracle databases

                     

                    This is what causes so much confusion and I cannot find a clear answer that keeping THP will create problem or not.

                    According to below link, If I using 11.2.0.4 use of both HP and THP will not create problem, In my situation, I have two tier architcture and not 3 tier, so database and application code will exist on same server.

                    http://scn.sap.com/community/oracle/blog/2013/06/17/oracle-myths-and-common-misconceptions-about-transparent-huge-pages-for-oracle-databases-on-linux-uncovered

                    • 7. Re: Transparent Huge Pages - Is there a need to disable them?
                      Dude!

                      Where does the information from the link you refer outline that THP and standard hugepages are not causing a problem for Oracle Database? Some of the information provided is actually copied from Oracle information sources and pretty much confirms it. I think nobody can force you not to use both, but if you run into issues, you will know the answer from Oracle technical support already. Regarding performance of your Java applications and THP there is only one real answer: Test it.

                       

                      Update: Here's another interesting link describing the probelm in more detail. Outlining that also other software, including Java is affected.

                       

                      https://blogs.oracle.com/linux/entry/performance_issues_with_transparent_huge