RHEL7 – How to disable transparent hugepages (THP)
Other Learning Articles that you may like to read
Free Courses We Offer
Paid Training Courses we Offer
Method 1: Create a customized tuned profile with disabled THP
Step 1: Initially, we should create a customized version of the currently running profile. The customized version will disable THP. Find out which profile is active, create a copy. In the following example we currently use the throughput-performance profile:
# tuned-adm active
Current active profile: throughput-performance
step 2: To create customized profile, create a new directory in /etc/tuned directory with desired profile name.
# mkdir /etc/tuned/myprofile-nothp
step #; Then create a new tuned.conf file for myprofile-nothp, and insert the new tuning info:
# cat /etc/tuned/myprofile-nothp/tuned.conf
Step 4: Make the script executable:
# chmod +x /etc/tuned/myprofile-nothp/tuned.conf
step 5: Enable myprofile like so:
# tuned-adm profile myprofile-nothp
This change will immediately take effect and persist reboots.
step 6: Now follow the below steps to add “transparent_hugepage=never” kernel parameter in grub configuration file.
Append or change the “transparent_hugepage=never” kernel parameter on the GRUB_CMDLINE_LINUX option in /etc/sysconfig/grub file. Save the file.
GRUB_CMDLINE_LINUX=”rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap vconsole.font=latarcyrheb-sun16 vconsole.keymap=us transparent_hugepage=never”
step 7: Run the grub2-mkconfig command to regenerate the grub.cfg file:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Step 8: Reboot the system and ensure the changes are working as expected. This can also be confirmed by running this command:
# cat /proc/cmdline
Method 2: Disable tuned services and modify GRUB
This resolution will disable the tuned services.
# systemctl stop tuned
#systemctl disable tuned
# tuned-adm off
Now add “transparent_hugepage=never” kernel parameter in grub configuration file as explained if above first method.
Reboot the server for changes to take effect.