Configuring Kernel Parameters for Linux

These sections explain how to configure kernel parameters manually for Linux if you cannot complete them using the fixup scripts.

Minimum Parameter Settings for Installation

Use this table to set parameters manually if you cannot use the fixup scripts.

Note:

  • Unless otherwise specified, the kernel parameter and shell limit values shown in the following table are minimum values only. For production database systems, Oracle recommends that you tune these values to optimize the performance of the system. See the operating system documentation for more information about tuning kernel parameters.
  • The values in this table are minimum values for manual configuration. If you used the Oracle Database Preinstallation RPM to complete your preinstallation configuration tasks, then the RPM configures these kernel parameters for you. The Preinstallation RPM can set higher values for these kernel parameters. Do not reduce a higher or different value configured by the Preinstallation RPM or by your system administrator solely to match the minimum value in this table.
  • If the current value for any parameter is greater than the value listed in this table, then the Fixup scripts do not change the value of that parameter.

Table: Minimum Operating System Resource Parameter Settings

ParameterValueFile

semmsl

semmns

semopm

semmni

250

32000

100

128

/proc/sys/kernel/sem
shmallGreater than or equal to the value of shmmax , in pages./proc/sys/kernel/shmall
shmmax

Half the size of physical memory in bytes

See My Oracle Support Note 567506.1 for additional information about configuring shmmax.

/proc/sys/kernel/shmmax
shmmni4096/proc/sys/kernel/shmmni
panic_on_oops1/proc/sys/kernel/panic_on_oops
kernel.panic10 (seconds)/proc/sys/kernel/panic
file-max6815744/proc/sys/fs/file-max
aio-max-nr

1048576

Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.

/proc/sys/fs/aio-max-nr
ip_local_port_range

Minimum: 9000

Maximum: 65535

/proc/sys/net/ipv4/ip_local_port_range
rmem_default262144/proc/sys/net/core/rmem_default
rmem_max4194304/proc/sys/net/core/rmem_max
wmem_default262144/proc/sys/net/core/wmem_default
wmem_max1048576/proc/sys/net/core/wmem_max

Changing Kernel Parameter Values

Use these instructions to display and change the kernel parameter values if they are different from the minimum recommended value.

Use the following commands to display the current values of the kernel parameters:

Table: Commands to Display Kernel Parameter Values

ParameterCommand
semmsl , semmns , semopm , and semmni

# /sbin/sysctl -a | grep sem

This command displays the value of the semaphore parameters in the order listed.

shmall , shmmax , and shmmni

# /sbin/sysctl -a | grep shm

This command displays the details of the shared memory segment sizes.

file-max

# /sbin/sysctl -a | grep file-max

This command displays the maximum number of file handles.

ip_local_port_range

# /sbin/sysctl -a | grep ip_local_port_range

This command displays a range of port numbers.

rmem_default# /sbin/sysctl -a | grep rmem_default
rmem_max# /sbin/sysctl -a | grep rmem_max
wmem_default# /sbin/sysctl -a | grep wmem_default
wmem_max# /sbin/sysctl -a | grep wmem_max
aio-max-nr# /sbin/sysctl -a | grep aio-max-nr

If you used the Oracle AI Database Preinstallation RPM to complete you preinstallation configuration tasks, then the Oracle AI Database Preinstallation RPM sets these kernel parameters for you. However, if you did not use the Oracle AI Database Preinstallation RPM or the kernel parameters are different from the minimum recommended value, then to change these kernel parameter values:

  1. Using any text editor, create or edit the /etc/sysctl.d/97-oracle-database-sysctl.conf file, and add or edit lines similar to:
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.shmall = 2097152
    kernel.shmmax = 4294967295
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65535
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576

    By specifying the values in the /etc/sysctl.d/97-oracle-database-sysctl.conf file, the values persist on system restarts.

  2. To change the current values of the kernel parameters:
    # /sbin/sysctl --system

    Review the output. If the values are incorrect, edit the /etc/sysctl.d/97-oracle-database-sysctl.conf file, then enter this command again.

  3. Confirm that the values are set correctly:

    # /sbin/sysctl -a
  4. Restart the computer, or run sysctl --system to make the changes in the /etc/sysctl.d/97-oracle-database-sysctl.conf file available in the active kernel memory.

Guidelines for Setting Kernel Parameter Values

  • In an Oracle RAC cluster, a node may experience higher utilization of I/O-related resources when workloads are transferred from other nodes. Consider increasing fs.file-max and fs.aio-max-nr on each node to support these scenarios, as the minimum values may not be sufficient for very large workloads.
  • If you used the Oracle AI Database Preinstallation RPM, then your kernel parameter settings reside in the /etc/sysctl.d/99-oracle-ai-database-preinstall-26ai-sysctl.conf file.
  • Include lines only for the kernel parameter values to change. For the semaphore parameters ( kernel.sem ), you must specify all four values. If any of the current values are larger than the minimum value, then specify the larger value.
  • The /etc/sysctl.conf file has been deprecated.
  • To obtain optimal performance and functionality from the Linux Kernel for ip_local_port_range , ensure that the selected range is large enough to accommodate the workload. Also ensure that the polarity is reversed for minimum and maximum values, that is, one value is even and the other is odd.
  • Avoid setting kernel parameter values in multiple files under /etc/sysctl.d/. The file with a lexically later name under /etc/sysctl.d/ takes precedence, followed by /etc/sysctl.conf. Oracle recommends that you use the Oracle AI Database Preinstallation RPM which, among other preinstallation tasks, also sets the kernel parameter values for your database installation.

    See also

    sysctl.conf(5) and sysctl.d(5) man pages for more information

Configuring Additional Kernel Settings for SUSE Linux

Additional kernel parameter settings configuration is required on SUSE Linux Enterprise Server systems.

Perform these steps on SUSE Linux Enterprise Server systems only:

  1. Enter the following command to enable the system to read the /etc/sysctl.conf file when it restarts:

    # /sbin/chkconfig boot.sysctl on
  2. Enter the GID of the oinstall group as the value for the parameter /proc/sys/vm/hugetlb_shm_group.

    For example, where the oinstall group GID is 501:

    # echo 501 > /proc/sys/vm/hugetlb_shm_group

    Use vi to add the following text to /etc/sysctl.conf, and enable the boot.sysctl script to run on system restart:

    vm.hugetlb_shm_group=501

Note:

Only one group can be defined as the vm.hugetlb_shm_group.

Setting UDP and TCP Kernel Parameters Manually

If you do not use a Fixup script or CVU to set ephemeral ports, then follow these guidelines to ensure smooth and high performance experience with least errors or issues.

  • Choose lower and higher numbers that are even/odd not both odd or both even.
  • Ensure that the lower range is set to 9000 or higher to avoid well known ports and those commonly registered for use by Oracle and other vendors or servers.
  • Set the port range high enough to include reserved ports for any applications you may intend to use and large enough ephemeral ports for the anticipated server workload.

For example, with IPv4, use the following command to check your current range for ephemeral ports:

$ cat /proc/sys/net/ipv4/ip_local_port_range
32768 61001

In the preceding example, the lowest port is set to 32768 and the highest port to 61001.

If necessary, update the UDP and TCP ephemeral port range to a range high enough for anticipated system workloads, and to ensure that the ephemeral port range starts at 9000 and above. For example:

# echo 9000 65535 > /proc/sys/net/ipv4/ip_local_port_range

Oracle recommends that you make these settings permanent. For example, as root, use a text editor to open /etc/sysctl.d/97-oracle-database-sysctl.conf, and add or change to the following: net.ipv4.ip_local_port_range = 9000 65535, and then restart the network:

$ sudo systemctl restart NetworkManager.service

Refer to your Linux distribution system administration documentation for information about automating ephemeral port range alteration on system restarts.