Wednesday, February 3, 2016

2247020 - SAP HANA DB: Recommended OS settings for RHEL 6.7

Symptom
You want to configure optimal settings for running HANA on RHEL for SAP HANA 6.7.


Other Terms
HANA, DB, BW on HANA, Suite on HANA, RHEL 6.7, speed, performance, Linux


Reason and Prerequisites
You are running SAP HANA in any flavour on RHEL for SAP HANA 6.7 and you want to configure optimal Linux settings.


Solution
To optimize the use of HANA DB with RHEL for SAP HANA 6.7, apply the following settings:
  • Disable transparent hugepages:
    With RHEL 6.7 the usage of transparent hugepages (THP) is generally activated for the Linux kernel. THP allow the handling of multiple pages as hugepages reducing the translation lookaside buffer footprint (TLB), in situations where it might be useful. Due to the special manner of HANA's memory management, the usage of THP may lead to hanging situations and performance degradations.

    To disable the usage of transparent hugepages set the kernel settings at runtime with the command

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

    There is no need to shut down the database to apply this configuration. This setting is then valid until the next system start. To persist this option, it is nessesary to edit the OS bootloader configuration. The location of the bootloader configuration file is either /boot/grub/grub.conf or on an (U)EFI system /boot/efi/EFI/redhat/grub.conf

    Edit this file and append the following parameter to all lines starting with “kernel”:

         transparent_hugepage=never

    Be aware that in a scale-out environment this has to be done on every server in the landscape.

  • Configure C-States for lower latency in Linux:
    The Linux kernel shipped with RHEL 6.7 includes a new cpuidle driver for recent Intel CPUs: intel_idle. This driver leads to a  different behaviour in C-states switching. The normal opererating state is C0, when the processor is put to a higher C state, it will save power. But for low latency applications, the additional time needed to start the execution of the code again will cause performance degradations.
    To see if the recommended driver is enabled, execute:

    # cat /sys/devices/system/cpu/cpuidle/current_driver

    The correct value should be "acpi_idle"

    If this is not the case, it is possible to fall back on the recommended driver by disabling the intel_idle driver in the kernel commandline by editing the OS bootloader configuration. The location of the bootloader configuration file is either /boot/grub/grub.conf or /boot/efi/EFI/redhat/grub.conf (on an (U)EFI system). Edit this file and append the following parameter to all lines starting with “kernel”:

        intel_idle.max_cstate=0

    If C-States are enabled in BIOS you might still see performance degradations. In this case either disable them in the BIOS or set the following parameter in addition to the previous one:

        processor.max_cstate=0

    To enable this change, a system reboot is required.

    In a scale-out environment, those changes have to be done on every server of the landscape. In case you already have a running HDB instance, rebooting the server should only be done when a standby server is configured. Do not reboot all servers at once. For single node instances a downtime has to be considered.

    For more information see https://access.redhat.com/site/solutions/202743 (Red Hat customer portal login required).

  • Runtime environment library:
    In order to run SAP HANA on RHEL 6.7, a compiler-related runtime library is required. The RPM package compat-sap-c++ needs to be installed in version 4.8.2-16 or later (see also SAP note 2228351).

    In order to be able to get access to the library, customers need subscriptions for “Red Hat Enterprise Linux Server for SAP HANA”. With this subscription you can subscribe your server to the “RHEL Server SAP HANA” channel on the Red Hat Customer Portal or your local Satellite server. After subscribing a server to the channel, the output of “yum repolist” must contain the following:
    rhel-x86_64-server-sap-hana-6 RHEL Server SAP HANA (v. 6 for 64-bit x86_64)

    Afterwards the runtime library can be installed with the following command:

    # yum install compat-sap-c++

  • Supported Kernel versions and patches to use with certified Hardware for SAP HANA on RHEL 6.7:
    You can use all official Linux Kernels shipped by Red Hat for RHEL 6.7, including security and bug fixes. I.e. using update Linux Kernels from RHEL 6.8 or higher is not allowed at the moment and will break the certification. Please refer to the following Red Hat knowledge base article for how to configure your system accordingly: Red Hat Enterprise Linux for SAP HANA: system updates and supportability.
    If additional 3rd-party binary kernel modules are loaded that complicate support for both SAP and the OS vendor (Red Hat) than the following SAP Note applies:
    784391 - SAP support terms and 3rd-party Linux kernel drivers
  • SELinux:
    RHEL 6.7 is delivered with SELinux enabled by default.
    Since there is no SELinux policy available for SAP HANA, leaving SELinux enabled can lead to problems when running SAP HANA on RHEL.

    To disable SELinux change the line:
SELINUX=enforcing
  to
SELINUX=disabled
  in /etc/sysconfig/selinux and reboot the system.
  • Update tmpwatch to prevent sapstartsrv lock files to be removed after 10 days:
    SAP sapstartsrv daemon create hidden lock files under /tmp, but the respective atime values are not being updated regularly.
    Tmpwatch default behaviour is to clean /tmp from files not being accessed for more than 10 days. As such the mentioned files are deleted after 10 days from the start of the application, potentially leading to a crash of the HANA application.

    In oder to avoid this situation, please update the package tmpwatch to at least version tmpwatch-2.9.16-5.el6_7.x86_64 and verify that the file /etc/cron.daily/tmpwatch contains the following entries:

    -X '/tmp/.hdb*lock' -X '/tmp/.sapstartsrv*.log'

    More detailed information can be found in the following Red Hat Knowledgebase article: https://rhn.redhat.com/errata/RHBA-2015-2002.html (Red Hat customer portal login required)

  • Distributed installation of HANA fails after updating package libssh2 to version 1.4.2-1.el6_6.1.x86_64:
    Version 1.4.2-1.el6_6.1.x86_64 triggers an incompatibility with different libssl and libcrypto versions. Please downgrade libssh2 to version libssh2-1.4.2-1.el6.x86_64. More detailed information can be found in the following Red Hat Knowledgebase Article: https://access.redhat.com/solutions/1370033 (Red Hat customer portal login required)

  • Database startup fails with an error message "/etc/sudoers mismatch for required permissions of Storage Connector" when using hdb_ha.fcClientLVM
    Append the following lines to the file /etc/sudoers file, replacing <sidadm> by the respective user name:

       Cmnd_Alias SIDALIAS = /sbin/multipath, /sbin/multipathd, /etc/init.d/multipathd, /usr/bin/sg_persist, /bin/mount, /bin/umount, /bin/kill, /usr/bin/lsof, /sbin/vgchange, /sbin/vgscan
       Defaults!SIDALIAS !requiretty
       <sidadm> ALL=NOPASSWD: SIDALIAS
Please note: All mentioned changes require root access on operating system level. Future implementations might lead to changes of these recommendations.



Header Data

Released On 01.12.2015 17:35:26
Release Status Released for Customer
Component HAN-DB SAP HANA Database
Priority Recommendations / Additional Info
Category Consulting

No comments:

Post a Comment