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

Do not tune down write-amp based rate limit when flush flow decreases #234

Merged
merged 4 commits into from
Aug 25, 2021

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Apr 19, 2021

Because foreground writes can be proactively restrained when compactions lag behind, added a minor algorithm change that avoids tuning down rate limit when foreground writes (flush flow) decrease. This will not affect the overall performance of WriteAmpBasedRateLimiter.

tabokie added 2 commits April 19, 2021 21:57
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

rest LGTM

Signed-off-by: tabokie <xy.tao@outlook.com>
@tabokie
Copy link
Member Author

tabokie commented Aug 12, 2021

Pin @yiwu-arbug

// Only adjust threshold when foreground write (flush) flow increases,
// because decreasement could also be caused by manual flow control at
// application level to alleviate background pressure.
new_bytes_per_sec = std::max(
Copy link
Collaborator

Choose a reason for hiding this comment

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

so when foreground flow decreases, we use long term average throughput as new rate limit? just want to understand the logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, and this is consistent with before:
When flush flow is steady, i.e. flush_flow.full() == flush_flow.recent(),
old algorithm yields new_bytes_per_sec = ratio * flush_flow.recent() = compaction_flow.full() / flush_flow.full() * flush_flow.recent() = compaction_flow.full()

Copy link
Collaborator

@yiwu-arbug yiwu-arbug left a comment

Choose a reason for hiding this comment

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

LGTM

@tabokie tabokie merged commit b071c44 into tikv:6.4.tikv Aug 25, 2021
@tabokie tabokie deleted the one-way-gate branch August 25, 2021 08:24
@tabokie tabokie mentioned this pull request May 9, 2022
39 tasks
tabokie added a commit to tabokie/rocksdb that referenced this pull request May 10, 2022
…tikv#234)

Because foreground writes can be proactively restrained when compactions lag behind, added a minor algorithm change that avoids tuning down rate limit when foreground writes (flush flow) decrease. This will not affect the overall performance of `WriteAmpBasedRateLimiter`.

Signed-off-by: tabokie <xy.tao@outlook.com>
tabokie added a commit that referenced this pull request May 11, 2022
…#234)

Because foreground writes can be proactively restrained when compactions lag behind, added a minor algorithm change that avoids tuning down rate limit when foreground writes (flush flow) decrease. This will not affect the overall performance of `WriteAmpBasedRateLimiter`.

Signed-off-by: tabokie <xy.tao@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants