-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][broker] Do not use IO thread for consumerFlow in Shared subscription #16304
[fix][broker] Do not use IO thread for consumerFlow in Shared subscription #16304
Conversation
@hangc0276 this is more details about This is when the read happens (it is actually “triggered”) for the Shared subscription (PersistentDispatcherMultipleConsumers)
And this is the Failover subscription
|
we are doing more performance testing with @dave2wave . I will make this patch as "ready" when we have full confirmation of the benefits |
@dave2wave reported that this patch brings some small improvements but not very much. btw I think that it is better to move this |
.../java/org/apache/pulsar/broker/service/persistent/PersistentDispatcherMultipleConsumers.java
Show resolved
Hide resolved
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.
LGTM, We'd better execute it in a separate thread pool instead of pulsar-io.
ping @codelipenghui @merlimat, Please help take a look.
/pulsarbot rerun-failure-checks |
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.
Why not just change to another thread for reading offloaded data? I think for the consume flow without offloader, we don't need this change?
And it's better to have a test data with this new change to make it can really resolve the problem.
Actually the read from offloader happens in another thread. This patch doesn't bring much improvement in performance. But it is a good clean up, in order to simplify how threading works for the Dispatcher. I was surprised when I found this difference |
@dave2wave confirmed that in his testing with OpenMessaging benchmarks this patch is a small win. so @codelipenghui I believe it is worth to do this change. I am sending other patches regarding this stuff in order to improve Shared subscriptions with Offloaders. |
129491a
to
14d990d
Compare
@hangc0276 @codelipenghui thanks for your review, I have simplified the patch. the last change is about the fact that in this class we are not using the Topic Ordered executor, so I have updated the code to use the same threadpool we use when calling readMoreEntries() |
14d990d
to
de1cdde
Compare
…ption (apache#16304) (cherry picked from commit 9f70219)
…request !70) [fix][broker] Do not use IO thread for consumerFlow in Shared subscription (apache#16304)
@eolivelli It looks does not make any change, BrokerService#executor also returns I/O threadpool. Is there any potential mechanism? |
Motivation
In
consumerFlow
for Shared subscriptions (PersistentDispatcherMultipleConsumers) we execute readMoreEntries and this happens in thepulsar-io
threadpool.In PersistentDispatcherSingleActiveConsumer (Failover/Exclusive) we defer the execution of that code to another threadpool
@dave2wave reported in OMB tests with offloaders that the execution of tests with Shared subscription is really less performant.
Modifications
Move the execution of readMoreEntries to the topic thread.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
doc-not-needed