How to change Semaphores on Solaris 10
How can I change the Semaphores on Solaris 10?
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.
Solaris 10 only uses the semmni, semmsl and semopm parameters. (Other
parameters are dynamic within the Solaris 10 IPC model.)
Solaris 10 only uses the semmni, semmsl and semopm parameters. (Other parameters are dynamic within the Solaris 10 IPC model.)
semmni (max-sem-ids in Solaris 10+): Maximum number of systemwide semaphore sets. Each control structure consumes 84 bytes. For Solaris 2.5.1-9, the default setting is 10; for Solaris 10, the default setting is 128. The maximum is 65535
In order to change the parameters for the particular user, first we need to identify, what project is the user member of:
1) log to the Solaris box as user you want to use to start database(s) with
2) "id -p"
uid=1057(user name) gid=300(support) projid=3(default)
3) log in as a root and use following commands to change the parameter (example:)
projmod -s -K 'process.max-sem-nsems=(privileged,1024,deny)' default
projmod -s -K 'project.max-sem-ids=(privileged,1024,deny)' default
4) RE-LOGIN the user from step 1) and run "prctl $$" in order to verify the settings, rebooting of the box is not required
Example of changing project.max-sem-ids
How to display the current semaphore value for "project.max-sem-ids"
# prctl -n project.max-sem-ids -i project user.root
project: 1: user.root
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
privileged 128 - deny -
system 16.8M max deny -
How to change the semaphore value for "project.max-sem-ids"
# projmod -s -K "project.max-sem-ids=(priv,256,deny)" user.root
NOTE: After changing the semaphore value, restart the current server session (ie puttty session) for the change to take affect.
semmsl (max-sem-nsems in Solaris 10+): Maximum number of semaphores per semaphore set. The default is 25, the maximum is 65535.
semopm (max-sem-ops in Solaris 10+): Maximum number of semaphore operations that can be performed in each semop call.
The default in Solaris 2.5.1-9 is 10, the maximum is 2 GB. Solaris 10 increased the default to 512
Translate this page: