BEA Logo BEA MessageQ Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   MessageQ Doc Home   |   Installation and Configuration Guide for UNIX   |   Previous Topic   |   Next Topic   |   Contents   

Configuring UNIX System Resources for MessageQ

 

This chapter contains the following topics that describe how to configure UNIX system resources to accommodate MessageQ software:

Overview of Configuring UNIX Resources for MessageQ

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:

  1. Calculate system resources and edit the kernel's configuration to change those resources.

  2. Rebuild the kernel if necessary and then reboot the system.

    Note: Whenever you change any system parameters in the kernel configuration file, you may need to modify the kernel and reboot your system to ensure those modifications take effect. For information on modifying and rebooting the kernel configuration file, see the Modifying the Kernel and Rebooting the System topic.

  3. Verify system resources.

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.

Table 2-1 MessageQ for UNIX Systems Resources

System Resources

Associated Parameters

Processes

MAXUPRC

Shared memory segments

SHMMNI, SHMSEG, SHMMAX

Semaphores

SEMMNI, SEMMNS, SEMMNU, SEMMSL, SEMOPM, SEMUME

Messages

MSGMAX, MSGMNB, MSGMNI, MSGSEG, MSGSSZ, MSGTQL

To accommodate your proposed MessageQ configuration, you might have to edit the kernel configuration and change the current system parameters. This is usually done with a system administration tool or by editing a configuration file. To change system parameters on UNIX platforms, see the user documentation for your particular system.

Calculating Process Resources

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 also 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:

Number of Process Slots

For Each...

3

Group

1

Group with Message Recovery Services (MRS) enabled

2

Cross-group connection

1

CLS process

1

Group with Selective Broadcast Services (SBS) enabled

1

Group using global naming

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.

Note: Do not change the configuration parameter MAXUPRC if new_maxuprc is less than the current value of MAXUPRC.

Calculating Shared Memory Segment Resources

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.

Number of Shared Segments

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 6 shared memory segments. Each application will attach to a specified number of shared memory segments.

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.

Size of Shared Segments

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 *  (3999 + 2)
[which equals 1616404]

You need to provide for shared segments up to 1,616,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 = (1616404 / alloc_size) + margin

Round up the result to the nearest whole number before adding the margin. For example, divide 1,616,404 (queue_info_segment) by 4096 (alloc_size), which comes out to 394.62988. Round up the result to 395 and add a margin of 30 to get a value of 425 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.

Location of Shared Segments

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.

Calculating Semaphore Resources

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:

For example, setting the following values are adequate for most applications:

Parameter

Recommended Value

Description

SEMMNI

50

Number of semaphore identifiers in the kernel. On most systems, the default is 50.

SEMMNS

150

Number of semaphores in the system. On most systems, the default is 60.

SEMMNU

30

Number of undo structures in the system. On most systems, the default is 30.

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:

Parameter

Minimum Value

Description

SEMOPM

3

Maximum number of semaphore operations executed per semop system call.

SEMMSL

3

Maximum number of semaphores per semaphore ID.

SEMUME

5

Maximum number of undo entries per undo structure.

Note: Do not change the current values of these parameters if they are higher than the minimum values listed.

Calculating Message Resources

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 GCP, LD, JRN, SBS, user applications)

1

User application process

The following kernel resource values are adequate for most applications.

Parameter

Recommended Value

Description

MSGMAP

100

Size of control map that manages message segments

MSGMAX

32767

Maximum size of a message, in bytes

MSGMNB

65535

Maximum length of a message queue, in bytes

MSGMNI

50

Maximum number of message queues system-wide

MSGSSZ

8

Size of a message segment, in bytes

MSGTQL

40

Number of message headers in the system

MSGSEG

16384

Number of message segments in the system (128 kilobytes total)

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

Modifying the Kernel and Rebooting the System

If you modified 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. To reconfigure the kernel, 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.

Verifying System Resources

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.

Before running the dmqivpipc program, change directory to the bin subdirectory of your MessageQ installation directory, for example:

# cd /install_dir/bin/

To run the dmqivpivc program, enter the following command:

# dmqivpipc -v -b num_buses -g num_groups -p num_processes

Where:

-v

Lists all parameters.

-b

Specifies the number of buses in the proposed configuration. The default is 1.

-g

Specifies the number of local groups in the proposed configuration. The default is 1.

-p

Specifies the number of application processes in the proposed configuration. The default is 1.

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 32767
* MSGSSZ * MSGSEG = 8192
parameter is low
preferred value is 65535
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:

Message

Description

Parameter is low

The current setting supports the proposed number of buses and groups; however, it might not support MRS and cross-group messaging

Parameter is too low

The current setting will not support the proposed number of buses and groups

Minimum value is ...

The value suggested will support the proposed number of buses and groups, but will not support MRS or cross-group messaging.

Preferred value is ...

The value suggested will support the proposed number of buses and groups, as well as MRS and cross-group messaging.