sijie commented on a change in pull request #6178: Introduce
maxMessagePublishBufferSizeInMB configuration to avoid broker OOM
URL: https://github.com/apache/pulsar/pull/6178#discussion_r379167731
##########
File path:
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -603,6 +603,23 @@
doc = "Max number of snapshot to be cached per subscription.")
private int replicatedSubscriptionsSnapshotMaxCachedPerSubscription = 10;
+ @FieldContext(
+ category = CATEGORY_SERVER,
+ doc = "Max memory size for broker handling messages sending from
producers.\n\n"
+ + " If the processing message size exceed this value, broker will
stop read data"
+ + " from the connection. The processing messages means messages
are sends to broker"
+ + " but broker have not send response to client, usually waiting
to write to bookies.\n\n"
+ + " It's shared across all the topics running in the same
broker.\n\n"
+ + " Use -1 to disable the memory limitation. Default is 1/5 of
direct memory.\n\n")
+ private int maxMessagePublishBufferSizeInMB = Math.max(64,
Review comment:
The default value should be a value that makes the broker behave as close to
the behavior without this code change. I understand we want to enable the
rate-limiting feature. So we should try to make the default value as 60% and
70% of max direct memory? Otherwise, people might experience unexpected
performance issues when they upgrade a broker from an old version to a newer
version.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services