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

前端 未结 5 1737
南笙
南笙 2021-01-04 01:28

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 P         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 02:18

    To disable Transparent Huge Pages (THP) permanently:

    1. Via GRUB options (preferred):

      Edit /etc/default/grub to add transparent_hugepage=never to the GRUB_CMDLINE_LINUX_DEFAULT option:

      GRUB_CMDLINE_LINUX_DEFAULT="transparent_hugepage=never quiet splash"
      

      After that, run update-grub command. (Need reboot to take effect)

    2. With rc.local:

      Edit /etc/rc.local and put following script before exit 0

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

    * To avoid reboot (as mentioned before), you can disable it by # echo never > /sys/kernel/mm/transparent_hugepage/enabled command.

提交回复
热议问题