Pivotal Knowledge Base

Follow

Disable Transparent Huge Pages (THP) for GemFire

Applies to

GemFire 7 and later

Purpose

Describe what THP is and how to disable it on a GemFire system running Linux.

Description

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.

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

Comments

Powered by Zendesk