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

Slack merge throttling params for fewer merge tasks #126016

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public class ThreadPoolMergeExecutorService {
private ThreadPoolMergeExecutorService(ThreadPool threadPool) {
this.executorService = threadPool.executor(ThreadPool.Names.MERGE);
this.maxConcurrentMerges = threadPool.info(ThreadPool.Names.MERGE).getMax();
this.concurrentMergesFloorLimitForThrottling = maxConcurrentMerges * 2;
this.concurrentMergesCeilLimitForThrottling = maxConcurrentMerges * 4;
this.concurrentMergesFloorLimitForThrottling = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put a comment here that this means to only decrease throttle rate when we submit a task and no other tasks are running?

this.concurrentMergesCeilLimitForThrottling = maxConcurrentMerges * 2;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps assert that concurrentMergesCeilLimitForThrottling >= concurrentMergesFloorLimitForThrottling - I feel like it adds readabililty.


boolean submitMergeTask(MergeTask mergeTask) {
Expand Down Expand Up @@ -230,10 +230,10 @@ private static long newTargetIORateBytesPerSec(
);
} else if (currentlySubmittedIOThrottledMergeTasks > concurrentMergesCeilLimitForThrottling
&& currentTargetIORateBytesPerSec < MAX_IO_RATE.getBytes()) {
// increase target IO rate by 10% (capped)
// increase target IO rate by 20% (capped)
newTargetIORateBytesPerSec = Math.min(
MAX_IO_RATE.getBytes(),
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 10L
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 20L
Copy link
Contributor

Choose a reason for hiding this comment

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

I think what you did only adds 5%, it should be:

Suggested change
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 20L
currentTargetIORateBytesPerSec + currentTargetIORateBytesPerSec / 5L

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this!

);
} else {
newTargetIORateBytesPerSec = currentTargetIORateBytesPerSec;
Expand Down