Chapter 8.
19
Setting Semaphores
Semaphores can best be described as counters which are used to provide synchronization between
processes or between threads within a process for shared resources like shared memories.
System
V
semaphores support semaphore sets where each one is a counting semaphore. So when an
application requests semaphores, the kernel releases them in sets. The number of semaphores per
set can be defined through the kernel parameter SEMMSL.
To see all semaphore settings, run:
ipcs -ls
8.1. The SEMMSL Parameter
This parameter defines the maximum number of semaphores per semaphore set.
Oracle recommends SEMMSL to be at least 250 for 9i R2 and 10g R1/R2 databases except for 9i
R2 on x86 platforms where the minimum value is lower. Since these recommendations are minimum
settings, it is best to set it always to at least 250 for 9i and 10g databases on x86 and x86-64
platforms.
Note
If a database gets thousands of concurrent connections where the
ora.init
parameter
PROCESSES
is very large, then SEMMSL should be larger as well. Note what
Metalink
Note:187405.1 and Note:184821.1 have to say regarding SEMMSL: "The SEMMSL
setting should be 10 plus the largest
PROCESSES
parameter of any Oracle database on
the system". Even though these notes talk about 9i databases this SEMMSL rule also
applies to 10g databases. I have seen low SEMMSL settings to be an issue for 10g RAC
databases where Oracle recommended to increase SEMMSL and to calculate it according
to the rule mentioned in these notes. An example for setting semaphores for higher
PROCESSES
settings can be found at
Section 8.6, “An Example of Semaphore Settings”
.
8.2. The SEMMNI Parameter
This parameter defines the maximum number of semaphore sets for the entire Linux system.
Oracle recommends SEMMNI to be at least 128 for 9i R2 and 10g R1/R2 databases except for 9i
R2 on x86 platforms where the minimum value is lower. Since these recommendations are minimum
settings, it is best to set it always to at least 128 for 9i and 10g databases on x86 and x86-64
platforms.
8.3. The SEMMNS Parameter
This parameter defines the total number of semaphores (not semaphore sets) for the entire Linux
system. A semaphore set can have more than one semaphore, and as the
semget(2) man
page
explains, values greater than SEMMSL * SEMMNI makes it irrelevant. The maximum number of
semaphores that can be allocated on a Linux system will be the lesser of: SEMMNS or (SEMMSL *
SEMMNI).
Summary of Contents for CLUSTER SUITE FOR ENTERPRISE LINUX 5.1
Page 7: ...Part I Tuning and Optimizing Red Hat Enterprise Linux for Oracle Database 9i and 10g ...
Page 8: ......
Page 10: ...4 ...
Page 16: ...10 ...
Page 28: ...22 ...
Page 30: ...24 ...
Page 36: ...30 ...
Page 42: ...36 ...
Page 54: ...48 ...
Page 60: ...54 ...
Page 68: ...62 ...
Page 72: ...66 ...
Page 88: ...82 ...
Page 90: ...84 ...
Page 92: ...86 ...
Page 94: ...88 ...
Page 98: ...92 ...
Page 108: ...102 ...
Page 112: ...106 ...
Page 120: ...114 ...
Page 122: ......
Page 128: ...122 ...
Page 132: ...126 ...
Page 134: ...128 ...
Page 142: ...136 ...
Page 146: ...140 ...
Page 156: ...150 ...
Page 160: ...154 ...