Solaris Tunable Parameters Reference Manual

System V Message Queues

System V message queues provide a message-passing interface that enables exchange of messages by queues created in the kernel. Interfaces are provided in the Solaris environment to enqueue and dequeue messages. Messages can have a type associated with them. Enqueueing places messages at the end of a queue. Dequeuing removes the first message of a specific type from the queue or the first message if no type is specified.

The module is dynamically loaded on first reference. Parameters provided to the subsystem are validated at that time. Entries in the /etc/system file must contain the msgsys: prefix.

This facility is different from the POSIX 1003.1b message queue facility.

The Solaris 8 release modified the use of some of the parameters for this facility. The msgsys:msginfo_msgssz, msgsys:msginfo_msgmap, and msgsys:msginfo_msgseg parameters are now obsolete. The variables have been left in place to avoid error messages. Any values applied are ignored.

The maximum number of messages the facility can handle at any one point in time is now entirely defined by msgsys:msginfo_msgtql. An array of message headers sized to the value specified in this variable is allocated and initialized as a free list. When an attempt is made to send a message, the free list is examined and if a header is available, a buffer is allocated from kernel memory to handle the message data. The data is copied into the buffer and the message is placed in the destination queue. When the message is read, the buffer is freed and the header placed on the free list.

Previous Solaris versions would limit the number of messages either by setting msgsys:msginfo_msgtql or by limiting the number of memory segments and the size of the segments that were allocated to a message buffer pool. When the module is first loaded, it allocates a number of data structures needed to manage messages. The total space allocated for these structures must not exceed 25% of available kernel memory, or the attempt to load fails and the following message is displayed.


msgsys: can't load module, too much memory requested

Unlike previous Solaris versions, a message buffer pool is not allocated as part of set up and is no longer considered in the 25% of memory check.

msgsys:msginfo_msgmax

Description

Maximum size of System V message.

Data Type

Unsigned long

Default

2048

Range

0 to amount of physical memory

Units

Bytes

Dynamic?

No. Loaded into msgmax field of msginfo structure.

Validation

None

When to Change

When msgsnd(2) calls return with error of EINVAL or at the recommendation of a software vendor.

Commitment Level

Unstable

msgsys:msginfo_msgmnb

Description

Maximum number of bytes that can be on any one message queue.

Data Type

Unsigned long

Default

4096

Range

0 to amount of physical memory

Units

Bytes

Dynamic?

No. Loaded into msgmnb field of msginfo structure.

Validation

None

When to Change

When msgsnd() calls block or return with an error of EGAIN, or at the recommendation of a software vendor.

Commitment Level

Unstable

msgsys:msginfo_msgmni

Description

Maximum number of message queues that can be created.

Data Type

Signed integer

Default

50

Range

0 to MAXINT

Dynamic?

No. Loaded into msgmni field of msginfo structure.

Validation

None

When to Change

When msgget(2) calls return with an error of ENOSPC or at the recommendation of a software vendor.

Commitment Level

Unstable

msgsys:msginfo_msgtql

Description

Maximum number of messages that can be created. If a msgsnd call attempts to exceed this limit, the request is deferred until a message header is available. Or, if the request has set the IPC_NOWAIT flag, the request fails with the error EAGAIN.

Data Type

Signed integer

Default

40

Range

0 to MAXINT

Dynamic?

No. Loaded into msgtql field of msginfo structure.

Validation

None

When to Change

When msgsnd() calls block or return with error of EGAIN, or at the recommendation of a software vendor.

Commitment Level

Unstable