Common Misconfigured HP-UX Resources (April 2006)

Tunables
Below are the tunables related to semaphores, which are described in the following table:
Tunable Description
sema
Enable or disable System V IPC semaphores at boot time
semaem
Maximum cumulative value changes per System V IPC semop() call
semmni
Number of System V IPC system-wide semaphore identifiers
semmns
Number of System V IPC system-wide semaphores
semmnu
Maximum number of processes that can have undo operations pending
semmsl
Maximum number of System V IPC semaphores per identifier
semume
Maximum number of System V IPC undo entries per process
semvmx
Maximum value of any single System V IPC semaphore
You can find links to these section 5 tunables on the HP documentation website at
http://www.docs.hp.com
.
Of the tunables described in the previous table, the semaem and semvmx tunables represent limits
associated with the values in the semaphores. These tunables do not affect semaphore memory
consumption. The other tunables, such as semmni, semmns, semmnu, semmsl and semume, are
related to memory utilization. The tunable sema is obsolete as of HP-UX 11i v2
The Semaphore Tables
Until recently, the semaphore tables were statically sized, meaning that entire tables were allocated in
memory when the system booted. Semaphores are allocated in groups of one or more from the
semaphore table using the semget() system call. The semget() system call returned a semaphore
ID from the semaphore ID table, which was then used to access the defined group of semaphores.
However, beginning with PHKL_26183 on HP-UX 11i v1, the semaphore entries that make up the
semaphore table were dynamically allocated. By dynamically allocating semaphores, the system was
able to reduce memory usage previously caused by allocated but unused semaphores. It can also
resolve the fragmentation issues that could occur in the semaphore table. Other tables such as the
semaphore undo table remained static.
The other significant change is related to the semaphore table itself. The semmns tunable now
represents a limit to the number of semaphores that can be allocated in total. They are allocated as
needed and freed when not in use. The caveat here is that the boot time table is still allocated even
though it is not used (in HP-UX 11i v1). As a result, you allocate space for semmns semaphores and
allocate space at run time for the semaphores that are currently in use. One other notable change
was put into PHKL_28703 for HP-UX 11i v1, which lifts the restriction of 32,767 on semmns. With
this patch installed, the new limit is 1,000,000.
The following figure shows the relationship between the semaphore ID table and the semaphore per
semaphore identifier.
32