INFODOC ID: 2273 SYNOPSIS: Kernel tuning parameters for message queues DETAIL DESCRIPTION: This is a quick description of the tunable message queue parameters available in Solaris 2.X. The tunable parameters are documented in the manuals: Solaris 2.1: SunOS 5.1 Administering Security, Performance, and Accounting (Appendix A) Solaris 2.2: SunOS 5.2 Administering Security, Performance, and Accounting (Appendix A) Solaris 2.3: Solaris 2.3 Administering Security, Performance, and Accounting (Appendix A) Solaris 2.4: Security, Performance, and Accounting Administration (Appendix A) Solaris 2.5: System Administration Guide, Volume 2 (Chapter 73) The variables are: msginfo_msgmap (100) Number of entries in the message map msginfo_msgmax (2048) Maximum message size msginfo_msgmnb (4096) Maximum bytes on queue msginfo_msgmni (50) Number of message queue identifiers msginfo_msgssz (8) Segment size of a message msginfo_msgtql (40) Number of system message headers msginfo_msgseg (1024) Number of message segments (MUST BE < 32768) These can be set in /etc/system using the syntax: set msgsys:X = N e.g., set msgsys:msginfo_msgseg=4096 In the rest of this document, the "msginfo_" part of the name above will be omitted for brevity. msgmax: ( default 2048 ) The parameter "msgmax" is the maximum number of bytes that can be in any one message. msgsnd() will give the error EINVAL if a message is longer than this. msgmnb: ( default 4096 ) The parameter "msgmnb" is the maximum number of message bytes that can be on any one queue at a given time. If a message would cause a queue to grow larger than this, that msgsnd() would either block until space was available, or would give the error EAGAIN if user specified non-blocking mode. For obvious reasons "msgmnb" must be at least as large as "msgmax", however, it is probably good to set it to some integral number of "msgmax." This way, a few messages of the maximum size could be queued at any time. However, making "msgmnb" too large compared to the total bytes available for messages (see below) may allow one queue to hog the message system. msgmni: ( default 50 ) The parameter "msgmni" is the number of message queue ids available to the system. Each message queue requires one id. msgget() gives the error ENOSPC if all the ids have been used up. msgtql: ( default 40 ) The parameter "msgtql" is the number of message queue headers available to the system. Each queued but as yet unread message requires one header. If none are available, msgsnd() will either block or give the error EAGAIN if non-blocking mode has been specified. msgssz & msgseg: ( defaults, 8 and 1024, respectively ) The parameters "msgssz" and "msgseg" together specify the total number of bytes available for all messages on all queues. The reason for two parameters is that the system allocates space to messages in discrete units called segments. Each segment contains "msgssz" bytes, and the system allocates "msgseg" of these segments. Therefore, the total number of bytes available on all queues is (msgssz * msgseg). msgmap: ( default 100 ) The parameter "msgmap" specifies the number of entries in the map that allocates message segments to messages. Each contiguous block of free segments requires one entry in the map. When segments are freed, if they are adjacent to another block of free segments, the two entries are combined. When a message is queued, a contiguous block of segments is required to hold the message. If many messages of varying lengths are being sent, it is possible that there is no single block of free segments available. Thus it is possible to "run out" of free space even if not all of the message arena is currently being used. If user gets a message on the console like: "msgmap: rmap ovflo, lost ...", what has happened is that all the entries in the map are in use and when the system tried to free a message's segments, it couldn't create a new entry in the map. When this occurs, the system discards that space, which means that it is permanently lost to the system until the message system is reinitialized. PATCH ID: n/a PRODUCT AREA: Kernel PRODUCT: IPC SUNOS RELEASE: Solaris 2.X UNBUNDLED RELEASE: n/a HARDWARE: Sun4, All