OS Memory and Kernel Parameters for SAP DB & Application Installation


Optimizing OS Memory and Kernel for SAP DB and Application Installation

In the world of SAP applications, the performance of your system is heavily dependent on how well your OS Memory and Kernel are configured. This blog post will delve into the intricacies of OS Memory and Kernel parameters for SAP DB and Application Installation.

Understanding the SAP Kernel

The SAP Kernel can be defined as a set of executable that run the SAP system. It’s crucial to ensure that the desired SAP Kernel version is compatible with the existing OS Kernel version and SAP product versions. This compatibility can be checked with the help of the Product Availability Matrix (PAM)¹.

Upgrading the SAP Kernel

The procedure to upgrade the kernel is as follows¹:

1. Decide the Target Kernel Version: After checking the compatibility, decide the target kernel version.
2. Download the Files: Download the DB independent, DB dependent files.
3. Create a Directory: Create a directory in the server.
4. Copy the Files: Copy the DB dependent and DB independent files into the newly created directory.
5. Extract the Files: Extract the files using SAPCAR executable.
6. Assign Authorization and Permissions: Once the files are extracted, assign the suitable authorization and permissions for the executable.
7. Stop the Application Services: Now stop the application services and make sure that there are no processes running.
8. Take a Backup: Take a consistent backup from the global directory.
9. Copy the New Kernel: Copy the newly extracted kernel to the global directory from the extracted path.
10. Check the Kernel Version: Once the kernel is copied, check the kernel version using the executable “disp+work”.
11. Run the Command: Run the command ./saproot.sh with root user from the global directory.
12. Start the SAP Instance: Once the checks are done we can start the SAP instance.
13. Validate the Kernel Version: Once the instance is up and running, validate the kernel version from the application layer as well.

Understanding OS Memory and Kernel Parameters for SAP

The OS memory and kernel parameters play a vital role in the performance of the SAP application. SAP provides specific notes for recommended OS settings for different Linux distributions³. These notes provide detailed information about the recommended settings for parameters like shared memory, semaphore parameters, file system parameters, network parameters, and others³.

Important OS Memory Parameters for running SAP Application or SAP DB. If you have multiple SAP instances running on same VM then these parameters are crucial to maintain and values can be calculated as per best standard.

OS Memory and Kernel
OS Memory and Kernel Parameters

32-bit Linux operating systems
SHMMAX is limited to 4 294 967 295 bytes.

Validation of OS parameters –

OS Memory and Kernel

SHMMAX limit is the maximum size of a shared memory segment on a Linux system.
SHMALL limit is the maximum allocation of shared memory pages on a system.

Recommended value to set the SHMMAX = amount of physical memory on your system. the minimum SHMMAX Value:

x86 systems (32bit) is 268435456 (256 MB)
for 64-bit systems, it is 1073741824 (1 GB).

Reference Link for SAP HANA Memory Configuration

Semaphores available to the operating system

SEMMNI: must be twice the maximum number of agents expected on the system multiplied by the number of logical partitions on the database server computer plus the number of local application connections on the database server computer

SEMMNS: Messages parameter on the OS level:
MSGMNI: parameter affects the number of agents that can be started.
MSGMAX : parameter affects the size of the message that can be sent in a queue 64 KB (that is, 65536 bytes),
MSGMNB: parameter affects the size of the queue 65536

Reference Link for SUSE HA and Disaster Commands

Linux standard values example from a ECC & Oracle running on SUSE and Oracle on Oracle Linux.
These values need to be maintained in sysctl.conf file and cane be reloaded without restarting the VM.

node1:root 01> cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
kernel.msgmni = 1024
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 41943040
fs.file-max = 6815744
kernel.sem = 1250 1024000 100 1024

How to reload sysctl.conf variables in Linux

Type the following command to reload settings from config files without rebooting the box via root user:

sysctl –system

The settings are read from all of the following system configuration files:



Optimizing the OS Memory and Kernel for SAP DB and Application Installation is a critical task that requires a deep understanding of both the SAP system and the underlying operating system. By following the guidelines and procedures outlined in this post, you can ensure that your SAP system runs smoothly and efficiently.

Remember, the key to a high-performing SAP system lies in the details of its configuration. So, take the time to understand these parameters and how they impact your system. Happy optimizing!

Recommended SAP Notes for OS Memory and Kernel Parameters

SAP Note – 2684254 – SAP HANA DB: Recommended OS settings for SLES 15 / SLES for SAP Application 15

SAP Note – 2663418 – Semaphore error -e=28 semget “No space left on device”

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.