Home / Resource Management / How to check currently using semaphores in Solaris ?

How to check currently using semaphores in Solaris ?

Many system administrators, particularly those managing large database servers, have had difficulty tuning shared memory and semaphore parameters in /etc/system. Often, these difficulties are experienced before starting an application instance. The Solaris[TM] 10 Operating System addresses this issue by integrating the System V IPC tunables into a powerful and flexible framework for easy administration. 

If you want to know, how many semaphores  are using on the Solaris system,use below command to check it.
#ipcs -s
IPC status from as of Thu Jul 26 13:32:36 EDT 2012
T ID KEY MODE OWNER GROUP
Semaphores:
s 83886476 0x56bd14 --ra-ra-ra- test sap
s 100663690 0x6f471c --ra-ra-ra- gnmsf sap
s 100663689 0x6f3970 --ra-ra-ra- tm052 sap
s 100663688 0x6f3330 --ra-ra-ra- xcdfm sap
s 83886977 0x3bfade --ra-r----- tm051 sap
s 83886976 0x3c4900 --ra-r----- tm051 sap
s 83886932 0x2dca0e --ra-r----- tm056 sap
s 83886931 0x2e182e --ra-r----- tm056 sap
s 83886930 0x2dca0f --ra-r----- tm056 sap
s 83886917 0x33bd7f --ra-r----- tm056 sap
s 67109695 0x2e182f --ra-r----- tm056 sap
s 100664108 0xa173b01a --ra------- root root

You can simple use ipcs -a |wc -l to see the total count.

# ipcs -a |wc -l
15

you have to subtract first three lines from that out. 15-3=12.


If you want to see including NSEMS value ,you can use below command,
#ipcs -sb
IPC status from as of Thu Jul 26 13:32:36 EDT 2012
T ID KEY MODE OWNER GROUP NSEMS
Semaphores:
s 83886476 0x56bd14 --ra-ra-ra- test sap 1
s 100663690 0x6f471c --ra-ra-ra- gnmsf sap 1
s 100663689 0x6f3970 --ra-ra-ra- tm052 sap 1
s 100663688 0x6f3330 --ra-ra-ra- xcdfm sap 1
s 83886977 0x3bfade --ra-r----- tm051 sap 20
s 83886976 0x3c4900 --ra-r----- tm051 sap 20
s 83886932 0x2dca0e --ra-r----- tm056 sap 20
s 83886931 0x2e182e --ra-r----- tm056 sap 20
s 83886930 0x2dca0f --ra-r----- tm056 sap 20
s 83886917 0x33bd7f --ra-r----- tm056 sap 20
s 67109695 0x2e182f --ra-r----- tm056 sap 20
s 100664108 0xa173b01a --ra------- root root 1

# id -p
uid=0(root) gid=0(root) projid=1(user.root)
Current project is user.root . you can find the same in /etc/project file as well.
[ QA - Root:~ # ] cat /etc/project
system:0::::
user.root:1::::

To check the maximum system value for above mentioned project user.root,

# prctl -n process.max-sem-nsems $$
process: 26108: bash
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
process.max-sem-nsems
privileged 512 - deny
system 32.8K max deny
#

Current limit for root user is 512 semaphores .
System Limit is 32.8K

We can modify the values using prctl on the fly.Please refer Resource-management for more information



Thank you for reading this article.Please leave a comment if you have any doubt ,i will get back to you as soon as possible.

VMTURBO-CLOUD-CAPACITY

Leave a Reply

Your email address will not be published. Required fields are marked *