Your Ad Here

IBM AIX/UNIX system storage administration ksh/perl scripting

Friday, March 14, 2008

Tunable IPC/Shared Memory Kernel Parameters in AIX

The information in this document pertains to AIX 4.3 through AIX 5L.
--------------------------------------------------------------------------
In many UNIX systems, the following IPC Kernel variables need to be configured:
maxssiz
msgmax
msgseg
msgtql
msgmnb
msgmni
msgssz
In AIX, these values are fixed and cannot be changed by the user. However, this should not cause any problems as the desired values are well within the AIX limits as described in the AIX 5.3 manual, "General Programming Concepts: Writing and Debugging Programs".

On most UNIX systems you edit the /etc/master file to set limits for IPC mechanisms, such as semaphore, shared memory segments, and message queues. The only problem with this method is that the higher the limits are set, the bigger the kernel gets, which can affect performance. AIX uses a different method.

In AIX, upper limits are set for IPC mechanisms and the individual IPC types are dynamically allocated or deallocated up to these upper limits. Therefore, the kernel grows and shrinks as IPC types are allocated. Thus, any performance hit lasts only for the life of the IPC type.

This difference between UNIX and AIX methods sometimes confuses users who are installing or using databases. The important thing to remember is that in AIX, IPC limits are taken care of for you. The only limit that may cause a problem is the maximum number of shared memory segments per process, which is eleven (11) for a 32-bit program.

The structures containing IPC limits are defined in three include files:
/usr/include/sys/sem.h
/usr/include/sys/msg.h
/use/include/sys/shm.h
The structures themselves are called seminfo, msginfo, and shminfo, respectively. Only the structures are defined, not the contents.
To attach to more shared memory regions, create a shell script that sets up the environment for the application and export the following:

EXTSHM=on
This will permit a user process to attach to more than 11 Shared Memory Regions.

Use of Extended Shared Memory (environment variable EXTSHM=ON) should NOT be configured globally in the /etc/environment file, and caution should be used in setting this variable in a profile.

Processes that use shared memory segments in a conventional manner will fail if they run with in an environment with EXTSHM=ON.

No comments:

Labels

BlogCatalog