views:

235

answers:

1

I am wondering what are the limitation of System-V message queue i.e. Maximum queue size, maximum size per item etc.

As I am working on integration of C++ with my PHP scripts and have very large amount of data which will be pushed into queue from php and C++ process will read that data on the other end. I have devised an strategy in which i have 2 types of messages that will be written by php.

1) Message length
2) Message data

But, I am facing unpredictable behavior in my C++ application which is responsible of reading length/data sequence.

Firstly, I am unable to write more than 6000 Bytes per msg_send from php, thats why I had to break my message into chunks lead by the complete message size. so my queue will look something like this (msgtype in parentheses)

Size(1) + Chunk(2) + Chunk(2) + Chunk(2) + Size(1) + Size(1) + Chunk(2) + Chunk(2)

Though, I am able to read a few chunks correctly, but in the middle of somewhere I start getting receive error and leaving some messages in the queue and rendering the queue just useless.

A: 

The limitations depend on your platform, OS version, and kernel parameters. You should consult documentation of your system. For example, you can get some info from msgctl() on Linux.

Michael