Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 419
thanuja Avatar asked Jun 28 '17 11:06

thanuja


People also ask

What is transparent large THP?

Transparent Huge Pages (THP) is a Linux memory management system that reduces the overhead of Translation Lookaside Buffer (TLB) lookups on machines with large amounts of memory by using larger memory pages.


2 Answers

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.

like image 127
Dmitriusan Avatar answered Sep 28 '22 02:09

Dmitriusan


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

like image 25
Anthony Avatar answered Sep 28 '22 01:09

Anthony