-
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
[pulsar-broker] add uniform load shedder strategy to distribute traffic uniformly across brokers #12902
Conversation
@rdhabalia:Thanks for your contribution. For this PR, do we need to update docs? |
1 similar comment
@rdhabalia:Thanks for your contribution. For this PR, do we need to update docs? |
d65500a
to
4f9fcf8
Compare
…ic uniformly across brokers
4f9fcf8
to
c0bae65
Compare
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.
+1
But I am not expert of this kind of algorithms.
So it is better to wait for some other review
@hangc0276 Please help review the PR. |
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.
And we need to update the doc of loadBalancerLoadSheddingStrategy
about this new strategy.
# uniform load shedding. (eg: broker1 with 50K msgRate and broker2 with 30K msgRate | ||
# will have 66% msgRate difference and load balancer can unload bundles from broker-1 | ||
# to broker-2) | ||
loadBalancerMsgRateDifferenceShedderThreshold=50 |
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.
IMHO, It's better to add a notice about how to enable uniform load shedding, like set loadBalancerLoadSheddingStrategy="org.apache.pulsar.broker.loadbalance.impl.UniformLoadShedder"
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.
added into documentation
+ "will have 4.5 times msgThroughout difference and load balancer can unload bundles " | ||
+ "from broker-1 to broker-2)" | ||
) | ||
private int loadBalancerMsgThroughputMultiplierDifferenceShedderThreshold = 4; |
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.
just wondering whether there would there need to be support for fractions like 1.5 ?
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.
yes, value is double and it supports fractions.
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.
@rdhabalia For the doc side, how about adding docs like below:
- Add a section
Load shedder strategy
to load balance chapter - Explain 3 strategies (
ThresholdShedder
,OverloadShedder
, andUniformLoadShedder
), including "when to use" and "how to use" for each strategy
If so, can you add them? Thanks!
83daf22
to
297a9f6
Compare
@Anonymitaet I have added documentation, if needed then we can always add more documentations in future. |
I think we'd better use the batch rate instead of the msg rate? the batch rate consumes the broker CPU resource and throughput consumes the network bandwidth. |
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.
Hi @rdhabalia thanks for adding docs, but users may not have enough patience to wade through “chunks" of information, so I re-organize them here and left some comments.
Can you help review and answer the questions? If the content makes sense, you can implement it into your .md files, thanks.
LoadBalancer only captures Please don't block the PR due to the documentation format. yes, I agree, the better format helps but the reorganization of the content can be handled in separate PR as well because every individual has a different idea about the formation. |
@Anonymitaet fixed typo about |
Hi @rdhabalia,
|
@Anonymitaet sure, I agree. let me create a separate PR with detailed info because we still have to add support of namespace isolation. so, can we unblock this PR and merge it for now and we can enhance with better user experience. |
@rdhabalia yes, it makes sense. Separate doc PR is more convenient for cutting a release (cherry-pick changes) as well. |
@Anonymitaet I still see blocker for this PR. Please avoid creating blocker for DOC. |
@rdhabalia I label this PR with |
…te traffic uniformly across brokers (apache#12902)" This reverts commit f965fb8.
…ic uniformly across brokers (apache#12902) * [pulsar-broker] add uniform load shedder strategy to distribute traffic uniformly across brokers * add documentation * fixed typo in documentation
Motivation
Pulsar Broker provides a configurable way to configure various load shedding strategies based on usecases. It already has strategies to load balance based on broker resource utilization (ThresholdShedder) or based on bundle usage threshold (OverloadShedder).
We need another strategy to distribute load uniformly across all brokers. So, we are adding
UniformLoadShedder
strategy to achieve goal for uniform load in cluster.NOTE
UniformLoadShedder
also requires isolation and broker weight mechanism to also use strategy in heterogeneous hardware. I will create another PR for this enhancement.