# 2205917 - SAP HANA DB: Recommended OS settings for SLES 12 / SLES for SAP Applications 12
# Description:    HANA DB settings

[version]
VERSION=63
DATE=18.05.2021
DESCRIPTION=SAP HANA DB: Recommended OS settings for SLES 12 / SLES for SAP Applications 12
REFERENCES=https://me.sap.com/notes/2205917

[login]
# /etc/systemd/logind.conf.d/saptune-UserTasksMax.conf UserTasksMax setting
# This file configures a parameter of the systemd login manager
# It sets the maximum number of OS tasks each user may run concurrently
# The behaviour of the systemd login manager was changed starting SLES12SP2
# to prevent fork bomb attacks.
# The value for UserTasksMax will be set to 'infinity'
# With this setting your system is vulnerable to fork bomb attacks
#
UserTasksMax=infinity

[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

[cpu]
# 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]
# rpm to check | os version | expected package version 
# kernel check
# XFS fix
#kernel-default 12 3.12.51-52.31.1
#kernel-default 12-SP1 3.12.51-60.20.2
# security
#kernel-default 12 3.12.61-52.72.1
#kernel-default 12-SP1 3.12.74-60.64.40.1
# bug fixing
#kernel-default 12-SP2 4.4.120-92.70.1
#kernel-default 12-SP3 4.4.120-94.17.1

# dependencies handled by saptune package installation
kernel-default 12 3.12.61-52.72.1
kernel-default 12-SP1 3.12.74-60.64.40.1
kernel-default 12-SP2 4.4.120-92.70.1
kernel-default 12-SP3 4.4.120-94.17.1
glibc 12-SP2 2.22-51.6
systemd 12-SP2 228-142.1
sapinit-systemd-compat 12 1.0-2.1
sapinit-systemd-compat 12-SP1 1.0-2.1
libssh2-1 12-SP4 1.4.3-20.3.1

[rpm:os=12-SP5]
libssh2-1 1.4.3-20.14.1

[rpm:os=12-SP4:arch=ppc64le]
kernel-default 4.12.14-95.13.1

[rpm:os=12-SP5:arch=ppc64le]
kernel-default 4.12.14-122.17

[grub]
# /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]
transparent_hugepage=never

[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!
