Disable Transparent Huge Pages (THP) for GemFire
search cancel

Disable Transparent Huge Pages (THP) for GemFire

book

Article ID: 294123

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

This article describes what THP is and how to disable it on a GemFire system running Linux.


Environment


Resolution

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. However, data intensive workloads often perform poorly with THP, because they tend to have sparse rather than contiguous memory access patterns. You should disable THP on Linux machines to ensure best performance with GemFire.

Note that it is recommended to run GemFire using the Java parameter: UseLargePages with any of the supported garbage collectors (CMS, G1GC and ZGC). This requires Huge Pages to be configured on the underlying OS. See enabling huge pages on Linux.

One method to disable Transparent HugePages is to add transparent_hugepage=never to the kernel boot line in the /etc/grub.conf file:

title GemFire Linux Server (2.6.39-400.24.1.el6uek.x86_64)
 root (hd0,0)
 kernel /vmlinuz-2.6.39-400.24.1.el6uek.x86_64 ro root=/dev/mapper/root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=es
 LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 rd_NO_DM rhgb quiet numa=off
 transparent_hugepage=never
 initrd /initramfs-2.6.39-400.24.1.el6uek.x86_64.img

The server must be rebooted for this to take effect.

Another method is to add the command to the /etc/rc.local file:

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

This option has the benefit of not getting unset when you upgrade from one kernel to the next.

You can confirm that it worked with the following command after rebooting:

$ cat /sys/kernel/mm/transparent_hugepage/enabled



Additional Information

Applies to

GemFire 9.10+