Enabling or Disabling Transparent Hugepages

You can modify transparent hugepages to meet Vertica configuration requirements:

  • For Red Hat 7/CentOS 7 and Amazon Linux 2.0, you must enable transparent hugepages. The installer reports this issue with the identifier: S0312.
  • For Red Hat 8/CentOS 8 and SUSE 15.1, Vertica provides recommended settings to optimize your system performance by workload.
  • For all other systems, you must disable transparent hugepages or set them to madvise. The installer reports this issue with the identifier: S0310.

Recommended Settings by Workload for Red Hat 8/CentOS 8 and SUSE 15.1

Vertica recommends transparent hugepages settings to optimize performance by workload. The following table contains recommendations for systems that primarily run concurrent queries (such as short-running dashboard queries), or sequential SELECT or load (COPY) queries:

Operating System Concurrent Sequential Important Notes
Red Hat 8.0/CentOS 8.0 Disable Enable

 

SUSE 15.1 Disable Enable

Additionally, Vertica recommends the following khugepaged settings to optimize for each workload:

Concurrent Workloads:
Disable khugepaged with the following command:

echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

Sequential Workloads:
Enable khugepaged with the following command:

echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

See Enabling or Disabling Defrag for additional settings that optimize your system performance by workload.

Disabling Transparent Hugepages on Red Hat 6/CentOS 6 Systems

If you are using Red Hat 7/CentOS 7, Red Hat 8/CentOS 8, SUSE 15.1, or Amazon Linux 2.0, you must enable, rather than disable transparent hugepages. See: Enabling Transparent Hugepages on Red Hat 7/8, CentOS 7/8, SUSE 15.1, and Amazon Linux 2.0.

Determine if transparent hugepages is enabled. To do so, run the following command.

cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] madvise never

The setting returned in brackets is your current setting.

If you are not using madvise or never as your transparent hugepage setting, then you can disable transparent hugepages in one of two ways:

  • Edit your boot loader (for example /etc/grub.conf). Typically, you add the following to the end of the kernel line. However, consult the documentation for your system before editing your boot loader configuration.
    transparent_hugepage=never
  • Edit /etc/rc.local and add the following script.
    if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
       echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
    fi

For systems that do not support /etc/rc.local, use the equivalent startup script that is run after the destination runlevel has been reached. For example SuSE uses /etc/init.d/after.local.

Regardless of which approach you choose, you must reboot your system for the setting to take effect, or run the following echo line to proceed with the install without rebooting:

echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled

Enabling Transparent Hugepages on Red Hat 7/8, CentOS 7/8, SUSE 15.1, and Amazon Linux 2.0

Determine if transparent hugepages is enabled. To do so, run the following command.

cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never

The setting returned in brackets is your current setting.

For systems that do not support /etc/rc.local, use the equivalent startup script that is run after the destination runlevel has been reached. For example SuSE uses /etc/init.d/after.local.

You can enable transparent hugepages by editing /etc/rc.local and adding the following script:

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

You must reboot your system for the setting to take effect, or, as root, run the following echo line to proceed with the install without rebooting:

# echo always > /sys/kernel/mm/transparent_hugepage/enabled

If you are using Red Hat 7.0 or CentOS 7.0 or higher, run the following command as root or sudo:

$ chmod +x /etc/rc.d/rc.local

Disabling Transparent Hugepages on Other Systems

SUSE did not offer transparent hugepage support in its initial 11.0 release. However, subsequent SUSE service packs do include support for transparent hugepages.

To determine if transparent hugepages is enabled, run the following command.

cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never

The setting returned in brackets is your current setting. Depending on your platform OS, the madvise setting may not be displayed.

You can disable transparent hugepages one of two ways:

  • Edit your boot loader (for example /etc/grub.conf). Typically, you add the following to the end of the kernel line. However, consult the documentation for your system before editing your bootloader configuration.

    transparent_hugepage=never
  • Edit /etc/rc.local (on systems that support rc.local) and add the following script.

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

For systems that do not support /etc/rc.local, use the equivalent startup script that is run after the destination runlevel has been reached. For example SuSE uses /etc/init.d/after.local.

Regardless of which approach you choose, you must reboot your system for the setting to take effect, or run the following two echo lines to proceed with the install without rebooting:

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