This chapter contains the following topics that describe how to configure UNIX system resources to accommodate MessageQ software:
MessageQ for UNIX software installs on all supported UNIX systems regardless of kernel configuration parameters. However, MessageQ applications using multiple buses, queues, and groups will probably require system resources beyond those currently allocated for your system.
After installing MessageQ for UNIX systems, you must calculate the kernel resources your MessageQ implementation requires and change those resource parameters. Your system must have sufficient resources before you configure MessageQ message queuing buses and groups. To configure your UNIX system to support MessageQ software, you must:
Overview of Configuring UNIX Resources for MessageQ
Note:
Whenever you change any system parameters in the kernel configuration file, you may need to rebuild the kernel and reboot your system to ensure those modifications take effect. For information on rebuilding and rebooting the kernel configuration file, see the Rebuilding the Kernel and Rebooting the System topic.
To properly configure your system, you need good working knowledge of the UNIX system on which the MessageQ software will be running. You also need access to your system's user documentation because you will reference it frequently. Table 2-1 lists the UNIX system resources affected by the MessageQ configuration.
To accommodate your proposed MessageQ configuration, you might have to edit the kernel configuration file and change the current system parameters. On Digital UNIX systems, you can edit all system parameters, including MAXUPRC, in the file /etc/sysconfigtab
.
To change system parameters on other supported UNIX platforms, see the user documentation for your particular system.
MessageQ for UNIX systems is implemented as a set of discrete system processes that communicate by way of shared memory, semaphores, and interprocess communication message queues. You must ensure that your system has sufficient process slots for MessageQ to run properly. Calculate the process slots required by MessageQ for UNIX systems as follows:
For example, you would calculate the process resources for a simple configuration with one bus, one group (X) with a cross-group connection, SBS and MRS enabled, one link to a group (Z) on another system, and a local naming agent as follows:
3 process slots per group = 3
1 process slot per group with MRS enabled = 1
1 process slot per group with SBS enabled = 1
1 process slot per group with naming enabled = 1
2 process slots per cross-group connection = 2
(Group X has 1 link to Z)
Total DMQ_process_slots = 8
A more complex configuration could consist of one bus and three groups labeled A, B, and C. All three groups have cross-group messaging enabled, with each group connected to the other two. Group A has MRS enabled. The number of processes required would be calculated as follows:
3 process slots per group = 9
1 process slots per group with MRS enabled = 1
2 process slots per cross-group connection = 12
(Group A has 2 links to B and C = 4)
(Group B has 2 links to C and A = 4)
(Group C has 2 links to A and B = 4)
Total DMQ_process_slots = 22
To determine the system configuration parameter MAXUPRC (the maximum number of process slots needed), use the following equation:
new_maxuprc = DMQ_process_slots + margin
Adding a margin to the required MessageQ process slots allows you to make small adjustments to your MessageQ configuration without having to reconfigure the kernel immediately. For example, setting the system configuration parameter MAXUPRC to 128 is adequate for most system applications.
Note:
Do not change the configuration parameter MAXUPRC if new_maxuprc
is less than the current value of MAXUPRC.
MessageQ uses shared memory segments to store the information needed to manage the messaging environment. You need to calculate the number, size, and location of the shared segments for your MessageQ for UNIX systems configuration.
User programs and MessageQ utilities must be able to map the MessageQ shared memory segments, as well as any other shared memory segments specific to a user application. For each group in your MessageQ configuration, you should have 5 shared memory segments.
Each application will attach to a specified number of shared memory segments. For all supported systems, setting the parameter SHMSEG to 24 is adequate for most applications.
You will also need to specify the maximum number of shared memory identifiers available to support your entire system configuration. Shared memory identifiers are set using the system configuration parameter SHMMNI. To determine the new value of SHMMNI, calculate the total number of shared segments for all buses and groups, include a margin for expansion, and add this total to the current value of SHMMNI. The formula is as follows:
new_shmmni = current_shmmni + margin + (6 * total_groups)]
Adding a margin to the system configuration parameter SHMMNI allows you to make small adjustments to your MessageQ configuration without having to reconfigure the kernel immediately. Setting the margin arbitrarily high might cause resource problems; setting the margin too low might prevent MessageQ from working correctly.
The maximum permitted shared memory segment size must be large enough for the largest MessageQ shared memory segment, which (in most cases) is the queue information segment. Calculate the size (in bytes) of the queue information segment as follows:
queue_info_segment = 404 * (999 + 2)
[which equals 404404]
You need to provide for shared segments up to 404,404 bytes. Using the allocation size for your system and the queue information segment, you can set the configuration parameter SHMMAX by using the following formula:
new_shmmax = (404404 / alloc_size) + margin
Round up the result to the nearest whole number before adding the margin. For example, on a Digital UNIX system, divide 404,404 (queue_info_segment
) by 4096 (alloc_size
), which comes out to 97.65625. Round up the result to 98 and add a margin of 30 to get a value of 128 for the configuration parameter SHMMAX. Adding the margin to SHMMAX allows you to make small adjustments to your MessageQ configuration without having to reconfigure the kernel immediately.
Note:
Do not change the configuration parameter SHMMAX if new_shmmax
is less than the current value of SHMMAX.
MessageQ maps shared memory by using the system default mapping. This means the system selects the address at which the shared memory will be mapped. Programs that dynamically expand their private data space can encounter problems if the default mapping location is not set sufficiently high.
Use the system configuration parameter SHMBRK to set the distance between private and shared data space. For most systems, setting the parameter to 4 megabytes is adequate. Note that on systems where SHMBRK is expressed in pages, divide the number of bytes by the page size to get the parameter value.
For example, the MRS journal process requires a minimum of 4 megabytes of heap space between the application code and the shared memory segments. If your application uses recoverable messaging, you may have to raise the SHMBRK parameter accordingly.
MessageQ uses semaphores to serialize access to shared data structures. You must have sufficient available semaphore resources for MessageQ to operate properly. The three resources you need to calculate are:
SEMMNI = (number of groups * 3)
SEMMNS = SEMMNI * 3
SEMMNU = DMQ_process_slots + number_of_application_processes
For example, setting the following values are adequate for most applications:
The SEMMNU parameter can limit the number of MessageQ processes, including all MessageQ system and application processes, that can run on a given system. Increasing the value of SEMMNU will allow you to attach more processes. The dmqivpipc
does not check or verify the SEMMNU parameter.
Note: If you have other applications that use semaphores, you must account for them when calculating your semaphore resources. For example, if you have determined MessageQ software needs 30 semaphore identifiers and you use another product that requires 20, you should set SEMMNI to at least 50. Otherwise, you will not be able to use both products simultaneously.
The following parameters should not be set lower than the listed minimum values:
Note: Do not change the current values of these parameters if they are higher than the minimum values listed.
MessageQ uses message queues to communicate with the queuing engine. Calculate the number of message queues needed as follows:
Number of Message Queues | For Each... |
---|---|
2 |
Group |
1 |
MessageQ server process (such as LD, JRN, SBS, user applications) |
1 |
User application process |
You must also ensure that your kernel has sufficient message queue resources to support the maximum user message size (32,000 bytes) for your MessageQ message queuing groups. The following values are adequate for most applications, and support a 32,000-byte user message without requiring a new kernel:
Note that some parameters are not defined on some systems. For systems that have these parameters, use the following equation to correctly set the parameter values:
MSGMNB < = MSGSEG * MSGSSZ < = 131072
If you edited the kernel configuration file and changed system parameters to support running MessageQ software, you may need to rebuild the kernel and reboot your system to ensure those changes take effect. For Digital UNIX platforms, you can use the /usr/sbin/doconfig
utility to rebuild the kernel. For more information on how to rebuild the kernel, refer to the Digital UNIX Guide to System Administration for DIGITAL UNIX. To reconfigure the kernel on other UNIX platforms other than Digital UNIX, refer to the user documentation for your particular system.
After rebuilding the system kernel, replace the old system kernel with the new version. Be sure to save a backup copy of the old system kernel. Then reboot your system.
After you change your system resources, you should test your proposed configuration against the new settings before configuring message queuing buses and groups.
To verify that you have set the system resources to support your proposed MessageQ configuration correctly, run the Installation Verification Process Interprocess Communications (dmqivpipc
) program. The dmqivpipc
program calculates the system resources required to support the proposed number of buses and local groups running on the local system, and compares the calculations against your current settings. The dmqivpipc
program warns you if the current settings are low or too low, and provides recommended settings that ensure your MessageQ software will have sufficient resources to run properly.
To run the dmqivpipc
program, change directory as follows:
# cd /usr/kits/DMx
400/bin/
where DM
x
is platform specific and will be one of the following:
|
Alpha |
|
All other supported UNIX systems |
To run the dmqivpivc
program, enter the following command:
# dmqivpipc -v -b num_buses -g num_groups -p num_processes
Where:
The following example shows the system resource analysis for a proposed configuration of 3 buses and 7 groups.
# dmqivpipc -v -b 3 -g 7
Message Queue Parameters
MSGMNI = 50
MSGMAX = 8192
* MSGMNB = 8192
parameter is low
preferred value is 32768
* MSGSSZ * MSGSEG = 8192
parameter is low
preferred value is 65536
MSGTQL = 40
Semaphore Parameters
* SEMMNI = 10
parameter is too low
minimum value is 24
preferred value is 31
* SEMMNS = 60
parameter is too low
minimum value is 72
preferred value is 93
SEMMSL = 25
SEMOPM = 10
SEMUME = 10
Shared Memory Parameters
SHMMNI = 100
SHMSEG = 6
SHMMAX = 131072
Messages provided by the dmqivpipc
program are interpreted as follows: