Saturday 23 January 2021

Disable Transparent Huge Pages on Linux | TECHRELAM


 SAP HANA:Disable Transparent Huge Pages on Linux.

If you get error in SAP HANA THP error need to disable the THP in Linux kernel settings.

Run following command to disable the usage of transparent huge pages (THP).


"echo never > /sys/kernel/mm/transparent_hugepage/enabled"

Afterwards, you can check the setting by cat this file. If it returns [never], it means now THP is disabled.


"cat /sys/kernel/mm/transparent_hugepage/enabled"


always madvise [never]

 

Note: The above command will stop only creation and usage of the new THP. The THP which were created and used at the moment, when the command was run, would not be disassembled into the regular memory pages. To get rid of the THP used, you need to restart the corresponding process.

To check system-wide THP usage:

"grep AnonHugePages /proc/meminfo"

 
---> If this command returns a non zero size of AnonHugePages, it means some size of THP is still used.

To check which processes are using THP:

grep -e AnonHugePages /proc/*/smaps | awk '{ if($2>4) print $0}' | awk -F "/" '{print $0; system("ps -fp " $3)}'

Please restart the returned processes to release the used THP.

To make this change permanent, you need to integrate this command line within your system boot scripts.
e.g. If you are using file /etc/init.d/boot.local as boot script, add the line "echo never > /sys/kernel/mm/transparent_hugepage/enabled" to this file.

OR

you can add line "transparent_hugepage=never" to the kernel boot line in /boot/grub/grub.conf.
If you do not know which boot script is used by system, please contact the OS vendor.

 

 


EmoticonEmoticon

Note: only a member of this blog may post a comment.