How to disable Transparent Huge Pages (THP) in Ubuntu 16.04LTS

thanuja picture thanuja · Jun 28, 2017 · Viewed 22.2k times · Source

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?

Answer

Dmitriusan picture Dmitriusan · Jun 28, 2017

Did you try this command:

sudo su
echo never > /sys/kernel/mm/transparent_hugepage/enabled

?

Alternatively, you may install hugepages

sudo su
apt-get install hugepages
hugeadm --thp-never

As mentioned by @Anthony, the effect would not persist after a reboot. Use your distribution-specific method to do that every time after reboot.