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

bug: foyer-bench default arguments are not reasonable #628

Closed
Ma1oneZhang opened this issue Aug 4, 2024 · 5 comments · Fixed by #749
Closed

bug: foyer-bench default arguments are not reasonable #628

Ma1oneZhang opened this issue Aug 4, 2024 · 5 comments · Fixed by #749
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Ma1oneZhang
Copy link

I just run the following command:

./foyer-bench --dir /data/${USER}/tmp

The benchmark program memory usage increase fastly and will be killed soon.

My machine is AMD Ryzen Threadripper 3970X 32-Core Processor, and my mem capcity is 128GB, OS Version is Ubuntu 22.04 5.15.0-117-generic.

@MrCroxx MrCroxx self-assigned this Aug 4, 2024
@MrCroxx MrCroxx added the bug Something isn't working label Aug 4, 2024
@MrCroxx MrCroxx added this to the v0.11 milestone Aug 4, 2024
@MrCroxx
Copy link
Collaborator

MrCroxx commented Aug 4, 2024

Hi, @Ma1oneZhang . Thanks for the report.

Don't worry. Let me check.

@MrCroxx
Copy link
Collaborator

MrCroxx commented Aug 4, 2024

Hi, @Ma1oneZhang . I tried with my machine and you are right. This is because the default arguments are not reasonable.

I usually use a set of specified arguments to test some workload, so it has been a long time since I tested the defaults.

I'll fix the default arguments to make it reasonable.

Meanwhile, if you want to test your workload, you always need to provide your own configuration.

e.g. My commonly used arguments are:

RUST_BACKTRACE=1 RUST_LOG=info ./target/release/foyer-bench --dir /6536/foyer --mem 64 --disk 102400 --file-size 64 --get-range 10000 --flushers 4 --reclaimers 4 --time 60 --writers 256 --w-rate 4 --admission-rate-limit 500 --readers 1024 --r-rate 1 --runtime --compression none --distribution zipf --distribution-zipf-s 0.8 --metrics

Note: Make sure you are using a release version.

The full arguments can be viewed by foyer-bench -h:

bench tool for foyer - the hybrid cache for Rust

Usage: foyer-bench [OPTIONS] --dir <DIR>

Options:
  -d, --dir <DIR>
          Directory for disk cache data
      --mem <MEM>
          In-memory cache capacity. (MiB) [default: 1024]
      --disk <DISK>
          Disk cache capacity. (MiB) [default: 1024]
  -t, --time <TIME>
          (s) [default: 60]
      --report-interval <REPORT_INTERVAL>
          (s) [default: 2]
      --w-rate <W_RATE>
          Write rate limit per writer. (MiB) [default: 0]
      --r-rate <R_RATE>
          Read rate limit per reader. (MiB) [default: 0]
      --entry-size-min <ENTRY_SIZE_MIN>
          Min entry size (B) [default: 65536]
      --entry-size-max <ENTRY_SIZE_MAX>
          Max entry size (B) [default: 65536]
      --get-range <GET_RANGE>
          Reader lookup key range [default: 10000]
      --file-size <FILE_SIZE>
          Disk cache file size. (MiB) [default: 64]
      --flushers <FLUSHERS>
          Flusher count [default: 4]
      --reclaimers <RECLAIMERS>
          Reclaimer count [default: 4]
      --writers <WRITERS>
          Writer count [default: 16]
      --readers <READERS>
          Reader count [default: 16]
      --recover-concurrency <RECOVER_CONCURRENCY>
          Recover concurrency [default: 16]
      --admission-rate-limit <ADMISSION_RATE_LIMIT>
          Enable rated ticket admission picker if `admission_rate_limit > 0`. (MiB/s) [default: 0]
      --reinseriton-rate-limit <REINSERITON_RATE_LIMIT>
          Enable rated ticket reinsetion picker if `reinseriton_rate_limit > 0`. (MiB/s) [default: 0]
      --clean-region-threshold <CLEAN_REGION_THRESHOLD>
          `0` means use default [default: 0]
      --shards <SHARDS>
          Shards of both in-memory cache and disk cache indexer [default: 64]
      --metrics
          weigher to enable metrics exporter
      --runtime
          use separate runtime
      --compression <COMPRESSION>
          available values: "none", "zstd" [default: none]
      --distribution <DISTRIBUTION>
          Time-series operation distribution [default: none]
      --distribution-zipf-n <DISTRIBUTION_ZIPF_N>
          For `--distribution zipf` only [default: 100]
      --distribution-zipf-s <DISTRIBUTION_ZIPF_S>
          For `--distribution zipf` only [default: 0.5]
      --warm-up <WARM_UP>
          [default: 2]
      --flush

      --invalid-ratio <INVALID_RATIO>
          [default: 0.8]
      --eviction <EVICTION>
          [default: lfu]
      --trace-insert-us <TRACE_INSERT_US>
          Record insert trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-get-us <TRACE_GET_US>
          Record get trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-obtain-us <TRACE_OBTAIN_US>
          Record obtain trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-remove-us <TRACE_REMOVE_US>
          Record remove trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-fetch-us <TRACE_FETCH_US>
          Record fetch trace threshold. Only effective with "mtrace" feature [default: 1000000]
  -h, --help
          Print help (see more with '--help')
  -V, --version
          Print version

@Ma1oneZhang
Copy link
Author

Hi, @Ma1oneZhang . I tried with my machine and you are right. This is because the default arguments are not reasonable.

I usually use a set of specified arguments to test some workload, so it has been a long time since I tested the defaults.

I'll fix the default arguments to make it reasonable.

Meanwhile, if you want to test your workload, you always need to provide your own configuration.

e.g. My commonly used arguments are:

RUST_BACKTRACE=1 RUST_LOG=info ./target/release/foyer-bench --dir /6536/foyer --mem 64 --disk 102400 --file-size 64 --get-range 10000 --flushers 4 --reclaimers 4 --time 60 --writers 256 --w-rate 4 --admission-rate-limit 500 --readers 1024 --r-rate 1 --runtime --compression none --distribution zipf --distribution-zipf-s 0.8 --metrics

Note: Make sure you are using a release version.

The full arguments can be viewed by foyer-bench -h:

bench tool for foyer - the hybrid cache for Rust

Usage: foyer-bench [OPTIONS] --dir <DIR>

Options:
  -d, --dir <DIR>
          Directory for disk cache data
      --mem <MEM>
          In-memory cache capacity. (MiB) [default: 1024]
      --disk <DISK>
          Disk cache capacity. (MiB) [default: 1024]
  -t, --time <TIME>
          (s) [default: 60]
      --report-interval <REPORT_INTERVAL>
          (s) [default: 2]
      --w-rate <W_RATE>
          Write rate limit per writer. (MiB) [default: 0]
      --r-rate <R_RATE>
          Read rate limit per reader. (MiB) [default: 0]
      --entry-size-min <ENTRY_SIZE_MIN>
          Min entry size (B) [default: 65536]
      --entry-size-max <ENTRY_SIZE_MAX>
          Max entry size (B) [default: 65536]
      --get-range <GET_RANGE>
          Reader lookup key range [default: 10000]
      --file-size <FILE_SIZE>
          Disk cache file size. (MiB) [default: 64]
      --flushers <FLUSHERS>
          Flusher count [default: 4]
      --reclaimers <RECLAIMERS>
          Reclaimer count [default: 4]
      --writers <WRITERS>
          Writer count [default: 16]
      --readers <READERS>
          Reader count [default: 16]
      --recover-concurrency <RECOVER_CONCURRENCY>
          Recover concurrency [default: 16]
      --admission-rate-limit <ADMISSION_RATE_LIMIT>
          Enable rated ticket admission picker if `admission_rate_limit > 0`. (MiB/s) [default: 0]
      --reinseriton-rate-limit <REINSERITON_RATE_LIMIT>
          Enable rated ticket reinsetion picker if `reinseriton_rate_limit > 0`. (MiB/s) [default: 0]
      --clean-region-threshold <CLEAN_REGION_THRESHOLD>
          `0` means use default [default: 0]
      --shards <SHARDS>
          Shards of both in-memory cache and disk cache indexer [default: 64]
      --metrics
          weigher to enable metrics exporter
      --runtime
          use separate runtime
      --compression <COMPRESSION>
          available values: "none", "zstd" [default: none]
      --distribution <DISTRIBUTION>
          Time-series operation distribution [default: none]
      --distribution-zipf-n <DISTRIBUTION_ZIPF_N>
          For `--distribution zipf` only [default: 100]
      --distribution-zipf-s <DISTRIBUTION_ZIPF_S>
          For `--distribution zipf` only [default: 0.5]
      --warm-up <WARM_UP>
          [default: 2]
      --flush

      --invalid-ratio <INVALID_RATIO>
          [default: 0.8]
      --eviction <EVICTION>
          [default: lfu]
      --trace-insert-us <TRACE_INSERT_US>
          Record insert trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-get-us <TRACE_GET_US>
          Record get trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-obtain-us <TRACE_OBTAIN_US>
          Record obtain trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-remove-us <TRACE_REMOVE_US>
          Record remove trace threshold. Only effective with "mtrace" feature [default: 1000000]
      --trace-fetch-us <TRACE_FETCH_US>
          Record fetch trace threshold. Only effective with "mtrace" feature [default: 1000000]
  -h, --help
          Print help (see more with '--help')
  -V, --version
          Print version

Thanks for reply fastly, I gonna test the arguments on my machine.

@Ma1oneZhang
Copy link
Author

Ma1oneZhang commented Aug 4, 2024

RUST_BACKTRACE=1 RUST_LOG=info ./target/release/foyer-bench --dir /6536/foyer --mem 64 --disk 102400 --file-size 64 --get-range 10000 --flushers 4 --reclaimers 4 --time 60 --writers 256 --w-rate 4 --admission-rate-limit 500 --readers 1024 --r-rate 1 --runtime --compression none --distribution zipf --distribution-zipf-s 0.8 --metrics

The benchmark with the arguments works perfectly. Thanks again for your help and great contribution. Should I close the issue?

@MrCroxx
Copy link
Collaborator

MrCroxx commented Aug 4, 2024

Good to hear that works! Please keep the issue open. I'll close it after the default arguments are fixed. 🥰

@MrCroxx MrCroxx changed the title Benchmark maybe memleak? bug: foyer-bench default arguments are not reasonable Aug 4, 2024
@MrCroxx MrCroxx modified the milestones: v0.11, v0.12 Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants