8000 refactor: refine flush on close to mitigate burst by MrCroxx · Pull Request #956 · foyer-rs/foyer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: refine flush on close to mitigate burst #956

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

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

MrCroxx
Copy link
Member
@MrCroxx MrCroxx commented Apr 11, 2025

What's changed and what's your intention?

Please explain IN DETAIL what the changes are in this PR and why they are needed. :D

The original design cannot handle the burst admission pick on flush.

The new design uses a dedicated io throttle on flush to limit the enqueue rate.

Checklist

  • I have written the necessary rustdoc comments
  • I have added the necessary unit tests and integration tests
  • I have passed make all (or make fast instead if the old tests are not modified) in my local environment.

Related issues or PRs (optional)

#897 #926

Signed-off-by: MrCroxx <mrcroxx@outlook.com>
@MrCroxx MrCroxx added this to the v0.17 milestone Apr 11, 2025
@MrCroxx MrCroxx self-assigned this Apr 11, 2025
@MrCroxx
Copy link
Member Author
MrCroxx commented Apr 11, 2025

Test

cargo build --release && RUST_BACKTRACE=full RUST_LOG=info ./target/release/foyer-bench --file /dev/nvme2n1 --mem 8GiB --disk 1TiB --region-size 64MiB --get-range 1000 --flushers 8 --reclaimers 4 --time 10 --writers 64 --w-rate 64MiB --readers 256 --r-rate 16MiB --metrics --warm-up 2 --runtime separated --user-runtime-worker-threads 8 --read-runtime-worker-threads 8 --write-runtime-worker-threads 4 --engine large --entry-size-min 1KiB --entry-size-max 128KiB --blob-index-size 128KiB --recover-mode none --disk-write-throughput 1GiB --disk-read-iops 1000 --disk-read-throughput 100MiB --flush-on-close

Output:

Close takes: 7.620059793s

As expected.

@MrCroxx MrCroxx enabled auto-merge (squash) April 11, 2025 15:21
Copy link
codecov bot commented Apr 11, 2025

Codecov Report

Attention: Patch coverage is 79.43925% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
foyer-memory/src/test_utils.rs 0.00% 7 Missing ⚠️
foyer-memory/src/pipe.rs 0.00% 6 Missing ⚠️
foyer-memory/src/raw.rs 57.14% 3 Missing ⚠️
foyer/src/hybrid/cache.rs 94.64% 3 Missing ⚠️
foyer-storage/src/store.rs 75.00% 2 Missing ⚠️
foyer-bench/src/main.rs 90.90% 1 Missing ⚠️
Files with missing lines Coverage Δ
foyer-storage/src/engine.rs 59.81% <100.00%> (+0.93%) ⬆️
foyer-storage/src/io/throttle.rs 95.21% <100.00%> (+0.15%) ⬆️
foyer-storage/src/picker/utils.rs 94.54% <ø> (-0.04%) ⬇️
foyer-bench/src/main.rs 65.36% <90.90%> (+0.25%) ⬆️
foyer-storage/src/store.rs 80.11% <75.00%> (+0.22%) ⬆️
foyer-memory/src/raw.rs 89.20% <57.14%> (-0.44%) ⬇️
foyer/src/hybrid/cache.rs 85.29% <94.64%> (+1.22%) ⬆️
foyer-memory/src/pipe.rs 83.11% <0.00%> (-2.22%) ⬇️
foyer-memory/src/test_utils.rs 73.07% <0.00%> (-26.93%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrCroxx MrCroxx merged commit efa47f7 into main Apr 11, 2025
43 checks passed
@MrCroxx MrCroxx deleted the xx/refine-flush-on-close branch April 11, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant
0