Linux - Kernel Semaphore parameters

About

On Linux, A semaphore is a System V IPC object that is used to control utilization of a particular process.

Semaphores are a shareable resource that take on a non-negative integer value. They are manipulated by the P (wait) and V (signal) functions, which decrement and increment the semaphore, respectively. When a process needs a resource, a “wait” is issued and the semaphore is decremented. When the semaphore contains a value of zero, the resources are not available and the calling process spins or blocks (as appropriate) until resources are available. When a process releases a resource controlled by a semaphore, it increments the semaphore and the waiting processes are notified.

The Semaphore Kernel parameters

Semaphore Description Minimum
SEMMSL maximum number of semaphores per array 128
SEMMNS maximum semaphores system-wide
SEMOPM maximum operations per semop call
SEMMNI maximum arrays

How to

Display them ?

This command displays the value of the semaphore parameters:

# /sbin/sysctl -a | grep sem

Calculate them ?

  • Calculate the minimum total semaphore requirements using the following formula:
sum (process parameters of all database instances on the system) + system and other application requirements
  • Set semmns (total semaphores systemwide) to this total.
  • Set semmsl (semaphores per set) to 256.
  • Set semmni (total semaphores sets) to semmns / semmsl rounded up to the nearest multiple of 1024.

The following formula can be used as a guide, although in practice, SEMMNS and SEMMNU can be much less than SEMMNI * SEMMSL because not every program in the system needs semaphores.

SEMMNS = SEMMNU = (SEMMNI * SEMMSL)

Set them ?

In the file, /etc/sysctl.conf

kernel.sem = 2200 6400 200 25

Where:

kernel.sem = SEMMSL SEMMNS SEMOPM SEMMNI

Then reboot or run this command:

# /sbin/sysctl -p





Discover More
Card Puncher Data Processing
Exalytics - Timesten Configuration

Timesten on Exalytics To set the resource limits for TimesTen: Make the following changes and additions to the /etc/security/limits.conf file: Make the following shared memory kernel settings in...
Linux - Directory /proc/sys/kernel/

This directory contains configuration files that directly affect the operation of the Kernel acct — Controls the suspension of process accounting based on the percentage of free space available...
Linux - IPCS command

The ipcs command provides information on the ipc facilities. Resources may be specified as follows: -m: shared memory segments -q: message queues -s: semaphore arrays -a: all (this is...
Linux - System V Shared Memory IPC

System V IPC is meant to provide and entire IPC mechanism which provides three methods of communication: message queues, semaphores, and shared memory segments.
On Linux, how to change the Kernel Parameter values (sysctl.conf)?

This article talks the Kernel Parameters Management, and shows you how to change them. Enter the following command to display the current values of the kernel parameters: where para is the beginning...
Oracle Database 11gr2 Typical Installation
Oracle Database - Installation 11g Release 2 (11.2) on Linux OEL 5 (X86)

Installation of Oracle Database 11g Release 2 (11.2) on Oracle Enterprise Linux 5. Linux OEL installation login as root RAM: At least 1 GB swap space The following table describes...
Oracle Database Installationl Location 11gr2 Oel Linux X86 64
Oracle Database 11gR2 - Installation on Linux OEL 5 Update 5 (x86_64)

Installation of Oracle Database 11g Release 2 (11.2) x86_64 on Oracle Enterprise Linux 5 Update 5 on the file system (ie without ASM) or GRID. Linux OEL installation login as root ...
Timesten Component
Timesten - Database Installation and configuration on Linux

On UNIX/Linux systems before installing application, you must in general configure the following: The number of semaphores Allowable shared memory In addition for timesten, you need to perform the...



Share this page:
Follow us:
Task Runner