SUMMARY: How to add semaphores

From: Cindy Yoho (
Date: Thu Jan 19 1995 - 18:33:07 CST

Hi all,

Thanks to everyone who responded and to those who are even now responding!

The parameters I was looking for were

        SEMMNS - the max number of semaphores
        SEMMNI - the max number of semaphore sets
        SHMSIZE - shared memory segment size in kbytes

They apparently can be set in 3 different locations.

        1. In the kernel config file (/sys/sun4x/conf/GENERIC (or kernel name))
        2. In the include files where the default values are set
            (/usr/include/sys/sem.h & /usr/include/sys/shm.h)
        3. In the file /etc/system

Number 1 was the most recommended, Number 2 was discouraged by all, and Number
3 doesn't exits on any of my systems so I didn't look into that one.

Also mentioned by several helpful folks was the fact that the following
options, which are commented out in the GENERIC kernel, must be uncommented:

        options IPCMESSAGE # System V IPC message facility
        options IPCSEMAPHORE # System V IPC semaphore facility
        options IPCSHMEM # System V IPC shared-memory facility

Many people suggested values for the various relevant parameters, some
based on configurations similar enough to be very helpful. ORACLE uses
35 semaphores per instance, and the system also requires some, so an
initial setting somewhere around 100-150 seems appropriate for SEMMNS.
Trial and error seems to be the only way to determine the best setting,
as suggested values for SEMMNS ranged from 100 to 1000!
Other useful info included:

Each semaphore takes up only 8 bytes
Look in the AnswerBook!
Get O'Reilly's new System and Performance Tuning book

Thanks to the following people for their help, (Steve Keating) (Dan Transue) (Rob Stefens) (Glenn W Cantello) (Richard Sands) (Val Popa)
bobr@houston.wireline.SLB.COM ( Bob Reardon ) (David B. Brown) (Dave James)
mealmei@kn.PacBell.COM (Mark E. Almeida) (Sean Ward) (Jeff Hildebrandt) (Kevin Sheehan {Consulting Poster Child})
pamela@jupiter.Legato.COM (Pamela Pledger) (Emile Bartole) (Mark Owens) (Erik Gyllenstierna)


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:14 CDT