How to disable transparent huge pages (THP) in Ubuntu 16.04LTS

I am setting up an ambari cluster with 3 Ubuntu 16.04LTS virtual machines. However, I get the following warning:

The following hosts have Transparent Huge Pages (THP) enabled. 
THP should be disabled to avoid potential Hadoop performance issues.

How to disable THP in Ubuntu 16.04?

+5
source share
4 answers

Have you tried this command:

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

?

You can also set up huge pages.

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

As @Anthony mentioned , the effect will not persist after a reboot. Use your distribution method to do this every time after a reboot.

+6
source

Install:

sudo apt install hugepages

Then run:

sudo hugeadm --thp-never

, /etc/rc.local

+13

3 Ubuntu (14.x/16.x), .

  1. sudo apt-get install hugepages
  2. sudo hugeadm --thp-never
  3. sudo/bin/sed -i '$i/usr/bin/hugeadm --thp-never'/etc/rc.local
+4

(THP) :

  1. GRUB ():

    GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub transparent_hugepage=never transparent_hugepage=never GRUB_CMDLINE_LINUX_DEFAULT:

    GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=never quiet splash"
    

    update-grub. ( , )

  2. rc.local:

    /etc/rc.local exit 0

    if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
       echo never > /sys/kernel/mm/transparent_hugepage/enabled
    fi
    

* To avoid rebooting (as mentioned earlier), you can disable it using the command # echo never >/sys/kernel/mm/transparent_hugepage/enabled.

+2
source

Source: https://habr.com/ru/post/1680298/


All Articles