-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a configurable limit to message size, reduce default to 128 MiB #1812
Conversation
Add `max_message_size` configuration to configure limit in bytes. If message is bigger - channel exception will be thrown. Default limit is 128MB. There is still a hard limit of 521MB. [#161983593]
Should we consider adding some human-friendly configuration format (for example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means every published message goes through a single group leader process. Please move this to channel state since the value can be assumed a runtime constant.
@michaelklishin no, it's using ets tables https://github.com/erlang/otp/blob/master/lib/kernel/src/application_controller.erl#L332 |
Even then, why not make it a constant in the channel state and eliminate several new extra calls that would effectively always return the same value? |
Fair enough. The value can technically change during a channel lifetime, but that's not a public API, so we can move it to the channel state. |
This can save us some reductions by avoiding ets read. [#161983593]
I understand but it is unlikely to be a common event. We also can claim that the updated value (e.g. via |
* Use smaller messages for tests * No need to publish a message above the hard limit, use a helper (these are unit tests) * Wording
Discovered while doing acceptance. References #1812.
Proposed Changes
Motivation: very large messages can be problematic for Erlang distribution. The distribution message can only be up to 2GB, but there will be some additional data, so the message body should be even smaller.
Another issue is failure detection, which is based on heartbeats. If a message is taking too long to transfer, the cluster nodes can miss the heartbeat and break the cluster.
Things like garbage collection and general performance can also suffer with a bigger message sizes.
Add
max_message_size
configuration to configure the limit in bytes.If message is bigger - channel exception will be thrown, just like it was before for messages bigger than 2GB
Default limit is 128MB (134217728 bytes).
There is still a hard limit of 521MB (536870912), see rabbitmq/rabbitmq-common#289.
Types of Changes
Checklist
CONTRIBUTING.md
document