I am setting up an ambari cluster with 3 virtualbox VMs running Ubuntu 16.04LTS. However I get the below warning:
The following hosts have Transparent Huge Pages (THP) enabled.
THP should be disabled to avoid potential Hadoop performance issues.
How can I disable THP in Ubuntu 16.04?
All of these answers are out of date. Tried all of them, and the values keep getting overwritten.
The guide here actually works: https://docs.mongodb.com/manual/tutorial/transparent-huge-pages/
It needs to be a service that runs at startup properly, just follow this guide
Worked on Ubuntu 19.04, finally suppressed the redis warnings
To disable Transparent Huge Pages (THP) permanently:
Via GRUB options (preferred):
Edit
/etc/default/grub
to addtransparent_hugepage=never
to theGRUB_CMDLINE_LINUX_DEFAULT
option:After that, run
update-grub
command. (Need reboot to take effect)With rc.local:
Edit
/etc/rc.local
and put following script beforeexit 0
* To avoid reboot (as mentioned before), you can disable it by
# echo never > /sys/kernel/mm/transparent_hugepage/enabled
command.Did you try this command:
?
Alternatively, you may install hugepages
As mentioned by @Anthony, the effect would not persist after a reboot. Use your distribution-specific method to do that every time after reboot.
Install :
sudo apt install hugepages
Then run :
sudo hugeadm --thp-never
To persist the changes you can add this last command to /etc/rc.local
Below 3 commands fix the issue over Ubuntu(14.x/16.x) and also make it persistent on system boots.
sudo apt-get install hugepages
sudo hugeadm --thp-never
sudo /bin/sed -i '$i /usr/bin/hugeadm --thp-never' /etc/rc.local