[Proxy] Use shared internal and external executor for broker clients#13834
Closed
lhotari wants to merge 2 commits into
Closed
[Proxy] Use shared internal and external executor for broker clients#13834lhotari wants to merge 2 commits into
lhotari wants to merge 2 commits into
Conversation
lhotari
requested review from
315157973,
addisonj,
codelipenghui,
eolivelli,
hangc0276,
hezhangjian,
ivankelly,
merlimat,
michaeljmarshall and
rdhabalia
January 19, 2022 08:10
codelipenghui
approved these changes
Jan 19, 2022
eolivelli
approved these changes
Jan 19, 2022
eolivelli
left a comment
Contributor
There was a problem hiding this comment.
the change makes sense to me.
nice work!
do you have numbers to share in order to demonstrate the effects ?
Member
Author
@eolivelli I don't. The main impact is the fact that more threads won't be created when the number of proxy connections increase. btw. I noticed a surprising detail of the client usage in the proxy: the client isn't used at all. I'll revisit this PR. |
lhotari
marked this pull request as draft
January 19, 2022 09:35
Member
Author
|
This PR has been replaced with an improved solution in #13836. |
Member
Author
|
#13839 is for using shared executors for broker client / geo-replication clients |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Pulsar Proxy will create a new Pulsar Client instance for each and every proxied connection.
Currently 2 threads will be created for every Pulsar Client instance for the internal/IO and external/listener executors. This causes a lot of overhead and inefficiency in the Pulsar Proxy.
In the current solution, it's already possible to share the EventLoopGroup and HashedWheelTimer instances. Support for sharing the timer was added by #9802.
A recently merged PR, #12037, added support for sharing the the internal/IO and external/listener executors in PulsarClientImpl instances. This feature has been used in this PR to share the executors across all PulsarClientImpl instances created in the Pulsar Proxy.
Modifications
brokerClientNumIOThreadswhich can be used to configure the number of threads for the internal/IO executor. It defaults to 2 * number of available processors.