You can use msgset to set the size of the message queue, but the easiest way is to just set it on the kernel directly.

The default size is 64k. So here I set it to around 1Meg.

As root run:

echo 1000000 > /proc/sys/kernel/msgmnb

(I added to /etc/rc.d/rc.local on CentOS 5.5)

and you can check it with:

cat /proc/sys/kernel/msgmnb

To complete the story, I ran into this problem when I had hundreds of clients simultaneously trying to write to a full queue, and a server trying to read from it. For reasons I didn’t investigate, the server would see the queue as empty, even though it had 11 messages in the queue (use command: ipcs).

So for me, this is a quick work-around as I move to some other queuing system.

Leave a Reply