Wednesday, July 18, 2012

Semaphore

A semaphore can be thought of as a counter that is used to control access to a shared resource. Semaphores provide low level synchronization between processes (or threads within a process) so that only one process (or thread) has access to the shared segment, thereby ensuring the integrity of the shared resource.

Oracle recommeds setting some of the semaphore parameters to the largest PROCESS instance parameter setting in the database parameter files for all database hosted in the Linux system plus 10.

In Linux environments semaphore is controlled by parameter kernel.sem. This parameter is set along with other parameters in the configuration file /etc/sysctl.conf.

Following commands helps to check the current setting of semaphore parameter
# cat /etc/sysctl.conf | grep sem
# sysctl -a | grep kernel.sem
# ipcs -l

Example
# cat /etc/sysctl.conf | grep sem
kernel.sem = 250 32000 100 128

# sysctl -a | grep kernel.sem
kernel.sem = 250 32000 100 128

# ipcs -l
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 67108864
max total shared memory (kbytes) = 100663296
min seg size (bytes) = 1
------ Semaphore Limits --------
max number of arrays = 1000
max semaphores per array = 1000
max semaphores system wide = 32000
max ops per semop call = 1000
semaphore max value = 32767
------ Messages: Limits --------
max queues system wide = 16
max size of message (bytes) = 65536
default max size of queue (bytes) = 65536

To change the semaphore settings, the "kernel.sem" parameter value need to be changed in the /etc/sysctl.conf. This change wont take effect until server is rebooted. In order to make the change to take effect immediately the following command need to be executed.

# sysctl -p
Enhanced by Zemanta

1 comment:

  1. If some one desires to be updated with newest technologies afterward he must
    be visit this web site and be up to date all the time.


    Here is my homepage - Louis Vuitton Purses

    ReplyDelete