GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [fix][cli] Restore the 64M default client memory limit in pulsar-perf by AlvaroStream · Pull Request #26341 · apache/pulsar Conversation
Contributor
Fixes #26340 Motivation
The same run against a 3.0.x client completes normally, which makes this look like a client Before #20663, That PR added the ClientBuilder clientBuilder = PulsarClient.builder() .memoryLimit(arguments.memoryLimit, SizeUnit.BYTES) but the backing field has no initializer: @Option(names = { "-ml", "--memory-limit", }, ...) public long memoryLimit; so when the option is not supplied, public boolean isMemoryLimited() { return memoryLimit > 0; } So With the limit disabled there is no backpressure on the producer. When the brokers cannot keep up This also affects Modifications
Verifying this changeThis change is already covered by existing tests, such as
Added The end-to-end behaviour was verified against a 3-node cluster: Does this pull request potentially affect one of the following parts:If the box was checked, please highlight the changes
The default of the
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsFixes apache#26340 Before apache#20663, pulsar-perf never called ClientBuilder#memoryLimit, so it inherited the client default of 64M from ClientConfigurationData. That PR added a --memory-limit option and applied it unconditionally, but the backing field has no initializer, so an unset option passes 0. Since MemoryLimitController#isMemoryLimited is memoryLimit > 0, 0 disables the limit entirely, and pulsar-perf silently went from bounded to unbounded client memory. With the limit disabled, a producer that outruns the brokers accumulates outbound buffers without backpressure until direct memory is exhausted, failing with OutOfDirectMemoryError instead of throttling. Default memoryLimit to the client's own default and extract that default into ClientConfigurationData.DEFAULT_MEMORY_LIMIT_BYTES so the two cannot drift. Passing --memory-limit 0 still disables the limit explicitly.
lhotari
reviewed
Comment on lines
+102
to
+104
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before changing this, we'd need to find the actual root cause since this change will cause different pulsar-perf results in certain cases. This has happened in the past with changes in #13344. #15723 and #15748 were made at that time to address the performance regression, #15748 has some context. Although setting the memory limit will bound the memory usage, it changes the results. For users using specific parameters with an older version of the tool will get different results where the backpressure is expected to be applied by The intention of this change has been to apply backpressure: pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java Lines 336 to 341 in 2baa1f7
The possible root cause could be that this regresses in some way between 3.0.5 and 4.0.9.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I performed analysis with Claude and based on that, it seems that the If we change the default memory limit for pulsar-perf, I believe that the limit should be proportional to the max direct memory provided to pulsar-perf. The reason for this is that it would prevent silent performance regressions caused by the parameter change while capping the memory limit and preventing OOM. Code example of setting a parameter based on available direct memory: pulsar/pulsar-broker/src/main/java/org/apache/pulsar/broker/ManagedLedgerClientFactory.java Lines 99 to 103 in 083fd4c
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we make it the default so test can be compared and improve it later?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'd suggest taking the path where instead of setting the memory limit to 64M, it would be 50% of available direct memory. This would make pulsar-perf test results more consistent across versions since there hasn't been a limit in the past. Setting a limit changes the behavior significantly for many workloads since there will be less inflight messages. This would mainly impact tests where there are a lot of partitions and the message sizes are relatively large (for example 100 partitions, 32kB message size, very high message rate). The problem with the previous Hopefully this clarifies the reason why setting to 64M isn't something that I support and I'm instead recommending to make it dynamic, based on available direct memory.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
This was referenced
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
2 of 11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. [Bug] Pulsar-perf producer OutOfDirectMemoryError with slow brokerUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |