Skip to content
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

Add threshold for each unload round for uniform load shedder #13915

Conversation

hangc0276
Copy link
Contributor

Motivation

For current uniform load shedder, it will unload 50% of (max throughput - min throughput) or (max message rate - min message rate). If the max throughput is 500MB/s, and the min throughput is 0MB/s, it will unload 250MB/s throughput at a time, which will lead the broker into high load for unloading a lot of bundles and cause the broker unstable.

Another problem is that the current implementation has no min unload threshold limit. For example, if the max broker throughput is 1MB/s and the min broker throughput is 0MB/s, it will unload 0.5MB/s throughput from the max throughput broker, which is unnecessary and will cause bundle frequently unload.

Modification

  1. Change the default unload percentage from 50% to 20%, aiming to make the unload process smooth.
  2. Add MIN_UNLOAD_MESSAGE=1000 and MIN_UNLOAD_THROUGHPUT=1 * MB, which will skip the low throughput bundle unload and decrease the bundle unload frequency.

Documentation

Check the box below or label this PR directly (if you have committer privilege).

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@hangc0276 hangc0276 self-assigned this Jan 24, 2022
@github-actions github-actions bot added the doc-required Your PR changes impact docs and you will update later. label Jan 24, 2022
@hangc0276 hangc0276 added area/broker doc-required Your PR changes impact docs and you will update later. and removed doc-required Your PR changes impact docs and you will update later. labels Jan 24, 2022
@hangc0276 hangc0276 added this to the 2.10.0 milestone Jan 24, 2022
Copy link
Contributor

@Jason918 Jason918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mattisonchao mattisonchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions I hope you answer:

  • Whether this change should notify the users ?
  • Can MAX_UNLOAD_PERCENTAGE, MIN_UNLOAD_THROUGHPUTand MIN_UNLOAD_MESSAGE be customized by users?

Thanks!

@hangc0276 hangc0276 force-pushed the chenhang/reduce_unload_percentage_for_UniformLoadShedder branch from f70731b to b001103 Compare January 25, 2022 01:36
@hangc0276
Copy link
Contributor Author

Questions I hope you answer:

  • Whether this change should notify the users ?
  • Can MAX_UNLOAD_PERCENTAGE, MIN_UNLOAD_THROUGHPUTand MIN_UNLOAD_MESSAGE be customized by users?

Thanks!

@mattisonchao Thanks for your review. The feature was added in pulsar 2.10.0, and we will add doc to explain the unload strategy. For the default values, in most of cases, we don't need to change it, so we can make them default first aiming to make broker.conf simple. If it is necessary to configure by users, we can make it configurable latter.

@mattisonchao
Copy link
Member

Questions I hope you answer:

  • Whether this change should notify the users ?
  • Can MAX_UNLOAD_PERCENTAGE, MIN_UNLOAD_THROUGHPUTand MIN_UNLOAD_MESSAGE be customized by users?

Thanks!

@mattisonchao Thanks for your review. The feature was added in pulsar 2.10.0, and we will add doc to explain the unload strategy. For the default values, in most of cases, we don't need to change it, so we can make them default first aiming to make broker.conf simple. If it is necessary to configure by users, we can make it configurable latter.

I see.
@hangc0276 Thanks for your patient explanation.

@hangc0276 hangc0276 merged commit 2347fff into apache:master Jan 27, 2022
@Anonymitaet Anonymitaet added doc-complete Your PR changes impact docs and the related docs have been already added. and removed doc-required Your PR changes impact docs and you will update later. labels Jan 28, 2022
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
…13915)

### Motivation
For current uniform load shedder, it will unload 50% of (max throughput - min throughput) or (max message rate - min message rate). If the max throughput is 500MB/s, and the min throughput is 0MB/s, it will unload 250MB/s throughput at a time, which will lead the broker into high load for unloading a lot of bundles and cause the broker unstable.

Another problem is that the current implementation has no min unload threshold limit. For example, if the max broker throughput is 1MB/s and the min broker throughput is 0MB/s, it will unload 0.5MB/s throughput from the max throughput broker, which is unnecessary and will cause bundle frequently unload.

### Modification
Change the default unload percentage from 50% to 20%, aiming to make the unload process smooth.
Add MIN_UNLOAD_MESSAGE=1000 and MIN_UNLOAD_THROUGHPUT=1 * MB, which will skip the low throughput bundle unload and decrease the bundle unload frequency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc-complete Your PR changes impact docs and the related docs have been already added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants