This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
feat(throttle): support size-based write throttling #298
Merged
Conversation
This file contains 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
neverchanje
changed the title
throttle: support size-based write throttling
feat(throttle): support size-based write throttling
Aug 22, 2019
qinzuoyan
reviewed
Sep 4, 2019
qinzuoyan
reviewed
Sep 6, 2019
src/dist/replication/lib/replica.h
Outdated
@@ -418,7 +419,7 @@ class replica : public serverlet<replica>, public ref_counter, public replica_ba | |||
bool _inactive_is_transient; // upgrade to P/S is allowed only iff true | |||
bool _is_initializing; // when initializing, switching to primary need to update ballot | |||
bool _deny_client_write; // if deny all write requests | |||
throttling_controller _write_reqs_throttling_controller; // throttling by requests-per-second | |||
throttling_controller _write_qps_throttling_controller; // throttling by requests-per-second | |||
throttling_controller _write_size_throttling_controller; // throttling by KB-per-second |
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.
throttling by KB-per-second => throttling by bytes-per-second
qinzuoyan
approved these changes
Sep 17, 2019
vagetablechicken
approved these changes
Sep 18, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In this PR we introduce size-based (aka throughput) throttling strategy to handle the complex workloads that are hard to throttle using simple QPS-based strategy.
For example, a user will produce 3 sub-jobs in one Hadoop pipeline that writes totally different data size into Pegasus. Job1 is 200byte avg, Job2 is 1KB avg, Job3 is 20KB avg. But all of them are mostly in 10K QPS. For a multi-tenant deployment with 100MB/sec capacity, it's hard to give a proper limitation of QPS that satisfy all the workloads.
5000*delay*100
: (100% utilization for Job3, with 5000 QPS in delay-queue, but only 5% utilization for Job2)10000*delay*100
(200% utilization for Job3, this may lead to unhealthy cluster state).If we are able to throttle in throughput, the util of Job2 can be increased from 5% to 10%. Most importantly, the user won't blame us for unnecessary slow-down.
USAGE:
This PR also simplifies the usage of QPS throttling, for
50000*delay*100
, you can write50K*delay*100
.