Disabling Transparent HugePages Using Tuned

by | Oct 15, 2014 | Oracle | 2 comments

Jeff Stonacek, Principal Architect


If you are reading this post then you probably already know about HugePages in Linux. If not, then read this previous blog post, which describes HugePages.

In newer versions of Linux, specifically RHEL/OEL 6.x and SLES 11, transparent HugePages were introduced in an attempt to improve memory management. Transparent HugePages allow the kernel to dynamically allocate HugePages as needed. This differs from traditional HugePages that needed to be allocated in a contiguous block, typically at boot time. While dynamic allocation is a valid practice on systems that have an abundance of memory and are allocating HugePages in small increments, typical Oracle database environments do not behave that way. Oracle database servers typically have large memory requirements and allocate a HugePages at a demanding rate.

Leaving transparent HugePages enabled on an Oracle database server can cause performance issues, or worse, stability problems. Therefore, it is recommended to disable transparent HugePages for Oracle database servers.

Editing the kernel line in the grub.conf can file disable transparent HugePages. Below is an example:

title Oracle Linux Server Unbreakable Enterprise Kernel (3.8.13-
        root (hd0,0)
        kernel /vmlinuz-3.8.13-16.2.1.el6uek.x86_64 ro root=/dev/mapper/rootvg-
rootlv transparent_hugepage=never
        rd_NO_LUKS rd_LVM_LV=rootvg/rootlv LANG=en_US.UTF-8 rd_NO_MD 
        SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet numa=off
initrd /initramfs-3.8.13-16.2.1.el6uek.x86_64.img

The problem with this method is that the change has to be made every time the kernel is upgraded.


A better solution is to disable transparent HugePages with Tuned. Tuned is a daemon that starts at boot time and modifies the system based on a configuration file. Tuned continually monitors the system and makes modifications dynamically. If not already done, install Tuned as shown below.

yum install tuned
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use 
subscription-manager to register.
| 3.9 kB   00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tuned.noarch 0:0.2.19-13.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

Package                       Arch                    Version 
Repository                    Size
tuned                         noarch                   0.2.19-13.el6 
dvd                           94 k

Transaction Summary
Install 1 Package(s)

Total download size: 94 k
Installed size: 222 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : tuned-0.2.19-13.el6.noarch 
  Verifying : tuned-0.2.19-13.el6.noarch 

  tuned.noarch 0:0.2.19-13.el6


After installing Tuned, modify the appropriate Tuned profile to disable THP. To do this we will copy an existing profile and modify it.

cd /etc/tune-profiles
cp -r enterprise-storage enterprise-storage-no-thp
cd enterprise-storage-no-thp

Next, edit the ktune.sh script and set transparent HugePages to never.

vi ktune.sh


. /etc/tune-profiles/functions

start() {
        set_cpu_governor performance
        set_transparent_hugepages never
        multiply_disk_readahead 4

        return 0

stop() {

       return 0

process $@


Finally, enable the Tuned profile.

tuned-adm profile enterprise-storage-no-thp

Switching to profile 'enterprise-storage-no-thp'
Applying deadline elevator: dm-0 dm-1 sda                     [ OK ]
Applying ktune sysctl settings:
/etc/ktune.d/tunedadm.conf:                                   [ OK ]
Calling '/etc/ktune.d/tunedadm.sh start':                     [ OK ]
Applying sysctl settings from /etc/sysctl.conf
Starting tuned:                                               [ OK ]

# chkconfig --list | grep tuned
tuned           0:off 1:off 2:off 3:on 4:on 5:on 6:off

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


In this blog post we discussed how to disable transparent HugePages using Tuned. The benefit of using Tuned is that settings are persistent after a kernel upgrade.


  1. Thanks for this info. How do I disable transparent pages and enable huge pages in an Oracle Linux environment.

    The kernel is

    uname -r

    I tried multiple attempts and transparent (Anonpages) is always enabled and does not get disabled.

    • The short answer is, you don’t. As of Unbreakable Enterprise Kernel (UEK) 3.x, that is to say Oracle Enterprise Linux (OEL) 6.5 and above, Oracle has disabled transparent hugepages. The Red Hat kernels that come bundled with OEL still implement transparent hugepages. So, for people running the Red Hat kernel in OEL, the process for disabling transparent hugepages is still valid. But for people like yourself who are running the UEK above kernel version 3.x, transparent hugepages is no longer a concern.


Submit a Comment

Your email address will not be published. Required fields are marked *