-
Notifications
You must be signed in to change notification settings - Fork 404
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 throttle for DurableLog based on max outstanding bytes. #7030
base: master
Are you sure you want to change the base?
Add throttle for DurableLog based on max outstanding bytes. #7030
Conversation
Signed-off-by: Sachin Joshi <sachin.joshi@emc.com>
…e-durable-log-throttle
if (isThrottlingRequired()) { | ||
QueueStats stats = this.getQueueStats.get(); | ||
val excess = stats.getTotalLength() - this.maxOutstandingBytes; | ||
return Math.min(this.baseDelay, (int) Math.ceil(1.0 * excess * this.baseDelay / this.maxOutstandingBytes)); |
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.
Common has minimax
if (isThrottlingRequired()) { | ||
QueueStats stats = this.getQueueStats.get(); | ||
val excess = stats.getTotalLength() - this.maxOutstandingBytes; | ||
return Math.min(this.baseDelay, (int) Math.ceil(1.0 * excess * this.baseDelay / this.maxOutstandingBytes)); |
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.0 is not needed. Also have parentheses around (excess / max) for clarity and to preserve precision.
@Override | ||
boolean isThrottlingRequired() { | ||
QueueStats stats = this.getQueueStats.get(); | ||
return stats.getTotalLength() > this.maxOutstandingBytes; |
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.
This is different from some of the other throttlers. It won't throttle until it's already over the max and then will reach the max throttle when 2x the max. ThrottlerPolicy.CACHE_TARGET_UTILIZATION
for example provides a Target percentage to be used, which is taken as a fraction of the max. I think we can quite recently use this same value
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #7030 +/- ##
============================================
+ Coverage 86.35% 86.36% +0.01%
- Complexity 16047 16051 +4
============================================
Files 1031 1031
Lines 59815 59831 +16
Branches 6071 6074 +3
============================================
+ Hits 51653 51675 +22
+ Misses 4988 4983 -5
+ Partials 3174 3173 -1
... and 10 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sachin Joshi <sachin.joshi@emc.com>
Change log description
(2-3 concise points about the changes in this PR. When committing this PR, the committer is expected to copy the content of this section to the merge description box)
Purpose of the change
(e.g., Fixes #666, Closes #1234)
What the code does
(Detailed description of the code changes)
How to verify it
(Optional: steps to verify that the changes are effective)