The negative effects of Transparent Huge Pages (THP) on RHDS

Updated

THP and RHDS

Transparent Huge Pages (THP) Linux memory management feature is enabled by default on RHEL. While it does benefit some workloads in terms of performnace gains, it has been found to be counter productive when used with RHDS and the JEMALLOC memory allocator that ships with it.

THP works best with large, contigious allocation patterns but can actually degrade the performance for small, sparse allocation patterns, that are typical to RHDS with its sparse, database like workloads, and lead to a significant memory growth and overhead, where the RHDS server process resident memory size might eventually exceed the limit and get terminated by the OOM killer as the worst case scenario.

This is due to increased memory fragmentation, memory pressure, and additional work required by the kernel to coalesce and maintain THP for RHDS server process sparse memory allocation patterns.

To avoid these performance and memory consumption issues it is therefore recommended to disable the THP on any systems where RHDS is installed.

How to disable THP

The THP can either be disabled completely or only enabled for applications that request it explicitly. If your RHDS deployment host runs any applications that explicitly use THP you can use madvise instead of never in the procedures below.

To check if THP is enabled

To check the current status, run:

# cat /sys/kernel/mm/transparent_hugepage/enabled

To disable THP at boot time

Append the following to the kernel command line in grub.conf:

transparent_hugepage=never

To disable THP at run time

Run the following commands to disable THP on-the-fly:

# echo never > /sys/kernel/mm/transparent_hugepage/enabled
# echo never > /sys/kernel/mm/transparent_hugepage/defrag
Category
Components
Article Type