[improve][broker] Implement PIP-430 Pulsar Broker cache improvements - #24623
Conversation
…dCount to broker.conf
|
Here's the JMH results for the latest changes. The new Here's a visualization of the results: One interesting detail is that ActiveManagedCursorContainerImpl's algorithm would be faster than ManagedCursorContainer's algorithm for tracking the slowest cursor, assuming that most cursors are moving forward (which is the case). |
|
The recently added "experimental" test case The with PIP-430 defaults, Cache hits 98.56%, Cache misses 1.44% : with with The results vary quite a lot and these are values from single runs. However, it demonstrates a significant improvement in reducing the amount of cache misses in rolling restarts when PIP-430 defaults are used. |
|
Test logging was slightly impacting the results (I noticed it with async-profiler) and I made changes to configure Log4J logging in tests so that it can be diverted to file based logging instead of default console logging. The results are very similar on Dell XPS 2019 i9-9980HK (on Linux):
detailed:
|
|
This test is flaky, will need to address it. |
|
I also ran the test run on GCP on e2-highcpu-8 VM. The base VM setup was done using these instructions.
|
…esMillis to conf files and PIP doc
merlimat
left a comment
There was a problem hiding this comment.
The improvements looks super-impressive! Having the micro-benchmarks make a great case.
Only minor comments
|
While doing some validation, I noticed that Pulsar has a long time issue that consumers aren't able to keep with producers even when there are available resources unless I created #24695 about this. |
### Motivation apache/pulsar#24623: Updated: ``` public static EntryImpl create(Position position, ByteBuf data) ``` to ``` public static EntryImpl create(Position position, ByteBuf data, int expectedReadCount) ``` apache/pulsar#24427: Updated: ``` CompletableFuture<Void> updateTopicPoliciesAsync(TopicName topicName, TopicPolicies policies); ``` to ``` CompletableFuture<Void> updateTopicPoliciesAsync(TopicName topicName, boolean isGlobalPolicy, boolean skipUpdateWhenTopicPolicyDoesntExist, Consumer<TopicPolicies> policyUpdater); ``` ### Modifications Fix build issue caused by upstream interface changes
…arMockBookKeeper Partial cherry-pick of the testmocks changes from 490ba0c ([improve][broker] Implement PIP-430 Pulsar Broker cache improvements (#24623)), without the JFR read event interceptor parts which aren't needed on branch-4.0. Required so that CompactionTest compiles after cherry-picking ded1e42d352 (#25998), which uses PulsarMockBookKeeper.setDefaultReadEntriesDelayMillis.
Fixes #16421
Fixes #24656
Motivation
This is the 2nd implementation PR for "PIP-430: Pulsar Broker cache improvements: refactoring eviction and adding a new cache strategy based on expected read count"
Modifications
Documentation
docdoc-requireddoc-not-neededdoc-complete