ZeroMQ Message Size Length Limit?
Asked Answered
B

4

23

Suppose that several machines are interacting together using python's zeroMQ client.

These messages are naturally formatted as strings.

Is there a limit to the length of a message (string)?

Brush answered 1/7, 2011 at 2:51 Comment(1)
I added my 2 cents below. Let me know your thoughts.Kinsman
C
21

There is no limit to the size of messages being sent however small messages are handled differently than large messages (see here).

The max size of a small messages is defined in the source code at 30 bytes (see here, look for ZMQ_MAX_VSM_SIZE).

Cassicassia answered 1/7, 2011 at 6:53 Comment(3)
Clearly you never have tried to send something larger than 2^31 :)Kinsman
ZMQ_MAXMSGSIZE is an int64, so 2ˆ63 is more likely the limitLieutenant
They increased the size limit. :) It is now 33 bytes for 64bit and 37 bytes for 32bit platforms. github.com/zeromq/libzmq/blob/master/src/msg.hpp#L137Cointreau
B
5

There is the socket option ZMQ_MAXMSGSIZE which causes a peer sending an oversized message to be disconnected, but the default is "no limit".

Basia answered 27/7, 2015 at 16:26 Comment(2)
Does not answer the question.Kinsman
@Kinsman but the default is "no limit" does answer the question! IMHO this here is currently the most helpful answer (if you do not look in the comments of the accepted answer).Pendleton
C
2

No limit

As for small size messages transmitted within zmq_msg_t structures, their limit is 29 bytes (for zmq version 3.2.2)

"max_vsm_size = 29," quoted from https://github.com/zeromq/libzmq/blob/master/src/msg.hpp

Childs answered 9/7, 2013 at 22:6 Comment(0)
K
2

Some socket types support up to 2^64, but some less than 2^31.

You should build a protocol that keeps chunks below that size anyway, but this is the real answer.

https://github.com/zeromq/libzmq/issues/1332

Kinsman answered 26/1, 2016 at 5:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.