Operating System - HP-UX
1825764 Members
2123 Online
109687 Solutions
New Discussion

IPCS Queues and Kernel Parameters

 
SOLVED
Go to solution
James Brand
Frequent Advisor

IPCS Queues and Kernel Parameters

HPUX 10.20 - It would appear that the maximum size for a message queue is defined two ways in the kernel. The "msgmnb" parameter as I understand it is the maxumim number of bytes that can be in a single queue. Also according to SAM's help info, the maximum size is also set by (msgssz x msgseg), which is the maximum segment size times the maximum number of segments for a queue. If these do not agree then who wins? I suspect it is msgmnb.

Also when I do an "ipcs -qa" the QBYTES field (maximum number of bytes allowed on the queue) has different values for different queues. Where is this set? It often equal to the "msgmnb" kernel parameter but sometimes is much less. I don't see anywhere in the msgget function to set the queue size when it is created. Where is this value coming from?

Thanks,
Jim
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: IPCS Queues and Kernel Parameters

Hi James,

Your analysis is correct, the paramaters are used to indicate that I may have a few big messages or many small messages but in no case can the product exceed msgmnb. In 10.20 (and all 32-bit versions) the maximum size of a queue is limited by the number of bits (32) in
the msqid_ds struct fields. This limits you to 64K.

As to why the sizes are sometimes smaller, the programmer can make a msgctl() system call to
set the size.

Hope this helps, Clay
If it ain't broke, I can fix that.