# 2684254 - SAP HANA DB: Recommended OS settings for SLES 15 / SLES for SAP Applications 15
# Description:    HANA DB settings

[version]
VERSION=24
DATE=06.11.2024
DESCRIPTION=SAP HANA DB: Recommended OS settings for SLES 15 / SLES for SAP Applications 15
REFERENCES=https://me.sap.com/notes/2684254

[vm]
# Disable transparent hugepages (THP)
# changes /sys/kernel/mm/transparent_hugepage/enabled
# 'never' to disable, 'always' to enable
# SAP Note 2131662, 2031375
#
THP=never

# Kernel Samepage Merging (KSM). KSM allows for an application to register with
# the kernel so as to have its memory pages merged with other processes that
# also register to have their pages merged. For KVM the KSM mechanism allows
# for guest virtual machines to share pages with each other. In todays
# environment where many of the guest operating systems like XEN, KVM are
# similar and are running on same host machine, this can result in significant
# memory savings, the default value is set to 0.
#
KSM=0

[vm:os=15-SP5]
# Configure transparent hugepages (THP)
# changes /sys/kernel/mm/transparent_hugepage/enabled
# 'never' to disable, 'always' to enable or 'madvise'
# 'madvise' will enter direct reclaim like 'always' but only for regions that
# are have used madvise(MADV_HUGEPAGE). This is the default behaviour.
# SAP Note 2131662, 2031375
#
THP=madvise
[vm:os=15-SP6]
THP=madvise
[vm:os=15-SP7]
THP=madvise

[cpu:arch=x86_64]
# Energy Performance Bias EPB (applies to Intel-based systems only)
# energy_perf_bias: performance - 0, normal - 6, powersave - 15
# cpupower set -b 0, if system supports Intel's performance bias setting
# if system does not support Intel's performance bias setting - 'all:none' 
# is used in verify table
energy_perf_bias=performance

# CPU Frequency/Voltage scaling (applies to Intel-based systems only)
# The clock frequency and voltage of modern CPUs can scale, in order to save
# energy when there’s less work to be done. However HANA as a high-performance
# database benefits from high CPU frequencies.
# cpupower frequency-set -g performance
governor=performance

# force latency (applies to Intel-based systems only)
# configure C-States for lower latency
#
# input is a string, which is internally treated as a decimal (not a
# hexadecimal) integer number representing a maximum response time in
# microseconds.
# It is used to establish a latency upper limit by limiting the use of C-States
# (CPU idle or CPU latency states) to only those with an exit latency smaller
# than the value set here. That means only those states that require less than
# the requested number of microseconds to wake up are enabled, all the other
# C-States are disabled.
#
# ATTENTION: not idling *at all* increases power consumption significantly and
# reduces the life span of the machine because of wear and tear. So do not use
# a too strict latency setting. Prefere a "light sleep", because the impact on
# power consumption and life of the CPUs is less severe.
# But don't forget: The deeper the idle state, the larger is the exit latency.
#
force_latency=70

[sysctl]
# /proc/sys/kernel/numa_balancing
# Enables/disables automatic page fault based NUMA memory balancing.
# Memory is moved automatically to nodes that access it often.
# Enables/disables automatic NUMA memory balancing. On NUMA machines, there
# is a performance penalty if remote memory is accessed by a CPU. When this
# feature is enabled the kernel samples what task thread is accessing memory
# by periodically unmapping pages and later trapping a page fault. At the
# time of the page fault, it is determined if the data being accessed should
# be migrated to a local memory node.
# The unmapping of pages and trapping faults incur additional overhead that
# ideally is offset by improved memory locality but there is no universal
# guarantee. If the target workload is already bound to NUMA nodes then this
# feature should be disabled. Otherwise, if the system overhead from the
# feature is too high then the rate the kernel samples for NUMA hinting
# faults may be controlled by the numa_balancing_scan_period_min_ms,
# numa_balancing_scan_delay_ms, numa_balancing_scan_period_max_ms,
# numa_balancing_scan_size_mb, and numa_balancing_settle_count sysctls.
#
# Turn off autoNUMA balancing
# 0 to disable, 1 to enable
kernel.numa_balancing=0

[rpm]
# dependencies handled by saptune package installation
libopenssl1_0_0 15 1.0.2n-3.3.1
libssh2-1 15 1.8.0-2.35
kernel-default 15-SP2 5.3.18-24.24.1

[rpm:os=15:arch=ppc64le]
kernel-default 4.12.14-150.14.2

[rpm:os=15-SP3:arch=x86_64]
glibc 2.31-150300.46.1

[rpm:os=15-SP4:arch=x86_64]
glibc 2.31-150300.46.1

[grub:arch=x86_64]
# /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT
# saptune only checks the values. Changing the grub configuration is not
# supported by saptune
# some of these values are set by saptune during runtime, so changing the
# grub configuration is possible but not needed
#
# Configure C-States for lower latency in Linux (applies to Intel-based systems
# only) - see energy_perf_bias and governor in section [cpu]
intel_idle.max_cstate=1
processor.max_cstate=1

# Turn off autoNUMA balancing - see kernel.numa_balancing in section [sysctl]
numa_balancing=disable
# Disable transparent hugepages - see THP in section [vm]
# recommended for systems <=15SP4
transparent_hugepage=never

# Configure transparent hugepages (THP)
# recommended for systems >=15SP5
[grub:os=15-SP5:arch=x86_64]
transparent_hugepage=madvise
[grub:os=15-SP6:arch=x86_64]
transparent_hugepage=madvise
[grub:os=15-SP7:arch=x86_64]
transparent_hugepage=madvise

[filesystem:os=15-SP2]
xfs_options= -nobarrier, -barrier

[filesystem:os=15-SP3]
xfs_options= -nobarrier, -barrier

[reminder]
# IBM EnergyScale for POWER8 Processor-Based Systems (applies to IBM Power systems only) - not handled by saptune!
# IBM EnergyScale for POWER9 Processor-Based Systems (applies to IBM Power systems only) - not handled by saptune!
# HANA is not supported neither on Intel Cluster-On-Die (COD) technology nor on sub-NUMA clustering technology.
