8000 feat: impl disk cache read throttle by iops/throughput by MrCroxx · Pull Request #938 · foyer-rs/foyer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: impl disk cache read throttle by iops/throughput #938

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 9, 2025

Conversation

MrCroxx
Copy link
Member
@MrCroxx MrCroxx commented Apr 8, 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

As title.

TODO:

  • How to deal with disk cache miss caused by read throttle?
  • Skip disk cache refill on cache miss caused by read throttle.

UPDATE: Track the todos in a new issue. #939

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)

close #935

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

Test

Base cmd ($BASE):

cargo build --release && RUST_BACKTRACE=full RUST_LOG=info ./target/release/foyer-bench --file /dev/nvme2n1 --mem 4MiB --disk 1TiB --region-size 64MiB --get-range 1000 --flushers 8 --reclaimers 4 --time 600 --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

baseline

$BASE
Total:
disk total iops: 10809.3
disk total throughput: 1.5 GiB/s
disk read iops: 8934.4
disk read throughput: 540.2 MiB/s
disk write iops: 1874.9
disk write throughput: 1.0 GiB/s
insert iops: 61502.7/s
insert throughput: 3.8 GiB/s
insert lat p50: 2us
insert lat p90: 4us
insert lat p99: 8us
insert lat p999: 15us
insert lat p9999: 44us
insert lat p99999: 174us
insert lat pmax: 871us
get iops: 246966.5/s
get miss: 77.42% 
get throughput: 3.8 GiB/s
get hit lat p50: 1us
get hit lat p90: 371us
get hit lat p99: 4927us
get hit lat p999: 8255us
get hit lat p9999: 9535us
get hit lat p99999: 11199us
get hit lat pmax: 14591us
get miss lat p50: 21us
get miss lat p90: 46us
get miss lat p99: 101us
get miss lat p999: 172us
get miss lat p9999: 279us
get miss lat p99999: 615us
get miss lat pmax: 1511us

limit 100 MiB/s

$BASE  --disk-read-throughput 100MiB
Total:
disk total iops: 3496.2
disk total throughput: 1.1 GiB/s
disk read iops: 1640.1
disk read throughput: 100.0 MiB/s
disk write iops: 1856.1
disk write throughput: 1.0 GiB/s
insert iops: 58160.4/s
insert throughput: 3.6 GiB/s
insert lat p50: 2us
insert lat p90: 4us
insert lat p99: 8us
insert lat p999: 15us
insert lat p9999: 40us
insert lat p99999: 143us
insert lat pmax: 539us
get iops: 251752.3/s
get miss: 79.76% 
get throughput: 3.6 GiB/s
get hit lat p50: 0us
get hit lat p90: 30us
get hit lat p99: 3503us
get hit lat p999: 7359us
get hit lat p9999: 8639us
get hit lat p99999: 9599us
get hit lat pmax: 10751us
get miss lat p50: 19us
get miss lat p90: 43us
get miss lat p99: 92us
get miss lat p999: 159us
get miss lat p9999: 275us
get miss lat p99999: 547us
get miss lat pmax: 871us

limit 1000 iops

$BASE --disk-read-iops 1000
Total:
disk total iops: 2853.9
disk total throughput: 1.1 GiB/s
disk read iops: 1000.0
disk read throughput: 61.3 MiB/s
disk write iops: 1853.9
disk write throughput: 1.0 GiB/s
insert iops: 62409.7/s
insert throughput: 3.8 GiB/s
insert lat p50: 2us
insert lat p90: 3us
insert lat p99: 8us
insert lat p999: 15us
insert lat p9999: 38us
insert lat p99999: 158us
insert lat pmax: 659us
get iops: 285084.7/s
get miss: 81.04% 
get throughput: 3.8 GiB/s
get hit lat p50: 0us
get hit lat p90: 21us
get hit lat p99: 2527us
get hit lat p999: 6943us
get hit lat p9999: 8447us
get hit lat p99999: 9791us
get hit lat pmax: 12351us
get miss lat p50: 19us
get miss lat p90: 43us
get miss lat p99: 92us
get miss lat p999: 163us
get miss lat p9999: 307us
get miss lat p99999: 611us
get miss lat pmax: 995us

limit 100 MiB/s and 1000 iops

$BASE --disk-read-iops 1000 --disk-read-throughput 100MiB
Total:
disk total iops: 2817.0
disk total throughput: 1.1 GiB/s
disk read iops: 998.4
disk read throughput: 60.8 MiB/s
disk write iops: 1818.5
disk write throughput: 1.0 GiB/s
insert iops: 61268.5/s
insert throughput: 3.8 GiB/s
insert lat p50: 2us
insert lat p90: 3us
insert lat p99: 8us
insert lat p999: 15us
insert lat p9999: 41us
insert lat p99999: 153us
insert lat pmax: 595us
get iops: 273913.2/s
get miss: 80.57% 
get throughput: 3.8 GiB/s
get hit lat p50: 0us
get hit lat p90: 21us
get hit lat p99: 2479us
get hit lat p999: 6783us
get hit lat p9999: 8319us
get hit lat p99999: 9023us
get hit lat pmax: 10047us
get miss lat p50: 19us
get miss lat p90: 42us
get miss lat p99: 90us
get miss lat p999: 157us
get miss lat p9999: 275us
get miss lat p99999: 683us
get miss lat pmax: 927us

Copy link
codecov bot commented Apr 8, 2025

Codecov Report

Attention: Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
foyer-storage/src/picker/utils.rs 81.81% 2 Missing ⚠️
foyer-storage/src/store.rs 81.81% 2 Missing ⚠️
Files with missing lines Coverage Δ
foyer-storage/src/io/throttle.rs 95.05% <100.00%> (+0.13%) ⬆️
foyer-storage/src/picker/utils.rs 94.87% <81.81%> (-1.16%) ⬇️
foyer-storage/src/store.rs 87.08% <81.81%> (-0.11%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrCroxx MrCroxx requested review from hzxa21 and Li0k April 8, 2025 14:30
@MrCroxx MrCroxx merged commit 5078f43 into main Apr 9, 2025
43 checks passed
@MrCroxx MrCroxx deleted the xx/read-throttle branch April 9, 2025 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

feat: support read iops/throughput throttle
1 participant
0