1830021 Members
13883 Online
109998 Solutions
New Discussion

IPC Semaphores

 
SOLVED
Go to solution
rbiorn
Advisor

IPC Semaphores

Hi forum raiders!
What are the indications when the IPC Semaphores are way too high?

-ragnar-
"You cannot achieve anything beyond your wildest dreams --- if you don't have any wild dreams"
7 REPLIES 7
eran maor
Honored Contributor
Solution

Re: IPC Semaphores

Hi

Semaphores are typically incremented by a process to block other
processes while it is performing a critical operation or using a shared
resource. When finished, it decrements the value, allowing blocked
processes to then access the resource. Semaphores can be configured as
binary semaphores which have only two values: 0 and 1, or they can
serve as general semaphores (or counters) where one process increments
the semaphore and one or more cooperating processes decrement it. To
prevent undetectable overflow conditions, the kernel imposes a maximum
value limit beyond which semaphores cannot be incremented. This limit,
defined by the semvmx kernel parameter, must not exceed the maximum
value of an unsigned integer (65 535). Semaphores are not allowed to
have negative (less than zero) values.

you can also see info about the kernel params
in this site :
http://docs.hp.com//hpux/onlinedocs/os/KCparams.OverviewAll.html
love computers
Marcin Wicinski
Trusted Contributor

Re: IPC Semaphores

Hi,

Maybe the attached description of IPC semaphores kernel parameters will be helpful.

Later,
Marcin Wicinski
Magdi KAMAL
Respected Contributor

Re: IPC Semaphores

Hi Ragnar,

Semaphores are syncronizing mechanism by which we can ensure that a certain amount of process ( one or more, it depends ) are using a resource.

Initial test of a semaphore Guarding a resource is, if the semaphore counter is positif ?
If yes, the process can get into that resource
If Not, it will wait till the value of the semaphore counter will be positif and then the system will awake up that process to evaluate the value and goes into that resource.

Once that semaphore counter value is positif,
a process is able to go into that resource to execute the critical section guarded by the semaphore, the semaphore counter will be decremented to ensuree that all other request for that critical section will be scheduled in a waiting list till each individual process is finish with that resource ( Binary semaphore ).

Other kind of semaphore is fixing the max concurrent process with one resource.

Magdi
Sridhar Bhaskarla
Honored Contributor

Re: IPC Semaphores

Ragnar,

Straight answer to your question-

I have never seen Operating System directly reporting problems about Semaphores or Message Queues. I treat them as being completely controlled by the application than the system itself. We can only set the values of how they can be used. It is all upto the application how it manages the communication within it's processes.

If the values (mainly semmns and semmni) are too high, application will definitely report about them or we can check them using sar -m command.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Roger Baptiste
Honored Contributor

Re: IPC Semaphores

hi,

ipcs command can help you in tracking
the usage/current allocation of semaphore
values. check man of ipcs for options.


HTH
raj
Take it easy.
Wodisch
Honored Contributor

Re: IPC Semaphores

Hello Ragnar,

except for a non-booting kernel (for its size, possibly) I
do not know any reason for problems caused by having
too many semaphores (kernel parameter SEMMNS)!
You would just be wasting a little bit of RAM...

Just my ?0.02,
Wodisch
rbiorn
Advisor

Re: IPC Semaphores

Thank you all!
Background - I have a db-server with 4 instances. Weekly full backup with instances stopped is OK, but incrementel daily back with hot instances was cancelled by the CA ASO agent because it failed to get semaphore (no space left on device).
I have worked around this problem by reducing number of processess dedicated in the init.ora file. (I'am not sure my dbadm is too happy, but everything seems OK!)

Since 2 of you have given me some reading material, I am now going to the studying-mode.
Thank you all!
"You cannot achieve anything beyond your wildest dreams --- if you don't have any wild dreams"