Tuning Linux kernel parameters using "sysctl"

  • 3664772
  • 05-Feb-2008
  • 30-Apr-2012

Environment

Novell Open Enterprise Server (Linux based)
Novell SUSE Linux Enterprise Server 10
Novell SUSE Linux Enterprise Server 9
Novell SUSE Linux Enterprise Server 8
Novell SUSE Linux Enterprise Desktop 10

Situation

Kernel parameter settings, e.g. for shared memory or for semaphores, need to be tuned.

Resolution

In many situations, there is no need to tune Linux kernel parameter settings. In some cases, for example when Oracle products are used, a manufacturer recommends tuned settings.

When using Oracle products

A package called "orarun" is available for most Novell Linux products. It should be used when using Oracle product on Novell Linux products, as it takes care of setting kernel parameters in accordance with Oracle's recommendations.

Listing all available kernel parameters

Using "sysctl -a", the full list of kernel parameters that can be controlled through the sysctl mechanism is displayed, together with their current setting.

Manual setting of kernel parameters

The "sysctl" command can be used to change a kernel setting, e.g.
sysctl -w net.ipv4.conf.eth0.rp_filter=1
These changes affect the currently running kernel. They will be lost on reboot. To change settings permanently, add an appropriate line to the /etc/sysctl.conf file which is processed during system startup through the /etc/init.d/boot.sysctl script.

Additional Information

Parameters for System V IPC

One important class of tunable kernel parameters is that for Unix System V-style Inter Process Communication (System V IPC). System V IPC encompasses message passing, semaphores and shared memory. Run
info ipc
for detailed documentation on this topic.

Parameters for message passing

kernel.msgmni: number of message queue identifiers
kernel.msgmax: maximum size of a message.
kernel.msgmnb: default maximum size of a message queue (in bytes). On some other Unix systems, this parameter is known as MSGMAP.

Not implemented:
MSGTQL: maximum number of message headers system-wide.
MSGPOOL: total size in bytes of the message pool.

Not configurable:
MSGSEG: maximum number of message segments per queue.
MSGSSZ: size of a message segment.

Parameters for semaphores

SEMMSL: maximum number of semaphores per id
SEMMNS: maximum number of semaphores, system wide.
SEMOPM: maximum number of operations in one semop call.
SEMMNI: number of semaphore identifiers (or arrays), system wide.

These parameters are set, all together, through kernel.sem which holds the values, separated through whitespace, as follows: SEMMSL SEMMNS SEMOPM SEMMNI.

Not used or not implemented:
SEMAEM: adjust on exit max value.
SEMMNU: number of undo structures system-wide.
SEMUME: maximum number of undo entries per process.

Parameters for shared memory
kernel.shmmni: maximum number of shared segments, system wide
kernel.shmall: maximum shared memory, system wide
kernel.shmmax: maximum shared memory segment size

Not used or not implemented:
SHMSEG: maximum number of shared segments per process

Note:
Starting with SLES10 the values for shmall and shmmax are already set to what look like very high values. These values are now set to the maximum for the system by the kernel automatically, so there is no need to change them manually anymore.