bench: Add memory-limited FIO benchmarks with breach detection#1808
Merged
bench: Add memory-limited FIO benchmarks with breach detection#1808
Conversation
3ec17f3 to
7bd5172
Compare
7bd5172 to
2163d32
Compare
2163d32 to
2b4e145
Compare
…duce iterations" This reverts commit 1f0507b. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
…tection" This reverts commit 2b4e145. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
Add memory-limited siblings for the throughput benchmarks in bench.yml (S3 Standard bench + cache-bench) and bench_s3express.yml (bench). The new jobs build Mountpoint with --features mem_limiter, mount with --max-memory-target=512, and publish charts under dev/.../mem_limited/. The FIO benchmark scripts are now shared between the regular and memory-limited variants, driven by the S3_MAX_MEMORY_TARGET_MIB env variable. When set, they pass --features mem_limiter to cargo run, --max-memory-target to Mountpoint, and --mem-limit-mib to the log analyzer. Extend mount-s3-log-analyzer with an optional --mem-limit-mib flag that, when set, also emits <out_dir>/<test>_extra_metrics.json with peak RSS, reserved memory peaks for prefetch/upload areas and get_object/put_object pool kinds, and a breached flag. The _extra_metrics.json files are consumed only by the memory-limited CI jobs' Render memory summary step (render-mem-summary.sh), which renders a Markdown table to GITHUB_STEP_SUMMARY. They are not fed into the gh-pages benchmark charts. Breach is informational only; it does not fail the job. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
…rations Disable bench, latency-bench, and cache-bench jobs in bench.yml and bench_s3express.yml to only run mem-limited-bench and mem-limited-cache-bench jobs during memory limiter development. Reduce FIO iterations from 10 to 1 in fs_bench.sh and fs_cache_bench.sh for faster CI turnaround. This commit is intended to be reverted once development iteration is complete. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
Mountpoint log lines are prefixed with a tracing-subscriber timestamp, level, and target, so patterns anchored with ^ never match. Restore the original unanchored peak-RSS pattern and apply the same approach to the new labeled-metric pattern for mem.bytes_reserved and pool.reserved_bytes. Also restore the original Vec<u64> + max collection for peak RSS to keep the diff minimal. Without this fix, memory-limited CI runs produced extra_metrics.json files with all-zero values because every log line failed to match. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
A gauge metric is not emitted in Mountpoint logs until something actually reserves against it (e.g. pool.reserved_bytes[kind=get_object] does not appear in a write-only workload). Previously we defaulted absent keys to 0.0 in extra_metrics.json, which is indistinguishable from a true zero reservation. Drop absent keys from extra_metrics.json entirely and render them as "N/A" in the GitHub Actions summary table. This also makes the schema forward-compatible with future label values such as pool.reserved_bytes[kind=append] for incremental uploads. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
…duce iterations" This reverts commit 042ce4c. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
Replace the combined mem.bytes_reserved|pool.reserved_bytes regex and the (metric,labels) HashMap with four dedicated regexes and a fixed [Option<u64>; 4] table keyed by output field name. Drops the unreachable unit-suffix branch and simplifies the match-and-update code. Output schema and N/A rendering behaviour are unchanged. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
Add links to the three new memory-limited chart paths under the Regression Testing section of BENCHMARKING.md. Add a "## Memory Breach Detection" heading above the GitHub Actions summary table emitted by render-mem-summary.sh. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
b7e033b to
f0ca8ea
Compare
passaro
reviewed
Apr 21, 2026
- fold --max-memory-target into optional_args in fs_bench.sh and fs_cache_bench.sh instead of keeping a separate mem_target_arg. - take the extra-metrics output path as an explicit --extra-metrics-out CLI flag in mount-s3-log-analyzer instead of deriving it from the peak-memory output file's parent directory; pair it with --mem-limit-mib via clap's `requires` so either both are set or neither. - simplify peak tracking with Option::max. Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
Replace the separate *-mem-limited jobs with a strategy.matrix on the existing bench/cache-bench jobs. Each job now fans out to `default` and `mem-limited` variants driven by matrix vars (features, env, name/path suffixes, results subdir). The `Render memory summary` step is gated on the `mem-limited` variant. Results are uploaded to a `matrix.results_subdir`-derived S3 prefix so the two variants don't collide (github.job no longer disambiguates across matrix variants). Signed-off-by: Yerzhan Mazhkenov <20302932+yerzhan7@users.noreply.github.com>
yerzhan7
added a commit
that referenced
this pull request
Apr 24, 2026
Extend the S3 Express throughput benchmark matrix with two new variants that mount Mountpoint with `--incremental-upload`: - `incremental-upload`: default memory. - `incremental-upload-mem-limited`: also built with `--features mem_limiter` and mounted with `--max-memory-target=512`. Both variants run only the `write` and `mix` fio categories (incremental upload is an upload-path feature, so the `read` category is skipped). Matrix changes: - Two new columns on the existing `bench` matrix: `incremental_upload` (wired to `S3_INCREMENTAL_UPLOAD`) and `bench_categories` (wired to `S3_BENCH_CATEGORIES`). - The "Render memory summary" step now gates on `matrix.max_memory_target_mib != ''` so it fires for any mem-limited entry, not just the original `mem-limited` variant. Script changes (`fs_bench.sh`): - When `S3_INCREMENTAL_UPLOAD` is set, pass `--incremental-upload` to the mount command. - The fio categories are now driven by `S3_BENCH_CATEGORIES`; when unset, behaviour is unchanged (`read write mix`). gh-pages layout (follows the nesting convention from #1808): - dev/s3-express/bench/incremental_upload - dev/s3-express/bench/incremental_upload/mem_limited
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the existing FIO throughput benchmarks CI so that each supported workload also runs with Mountpoint built using
--features mem_limiterand mounted with--max-memory-target=512(MiB - fixed). Under this extra pressure, Mountpoint must stay within the configured budget; the new jobs surface per-test peak memory usage in a GitHub Actions step summary table so regressions/improvements in the memory limiter are easy to spot.Non-latency only. Same FIO job definitions are used for both the regular and memory-limited variants.
The existing
bench(S3 Standard),cache-bench, and S3 Expressbenchjobs are extended with astrategy.matrixthat fans each one out to two variants:default— unchanged behaviour.mem-limited— builds with--features mem_limiter, runs withS3_MAX_MEMORY_TARGET_MIB=512, and emits an extra GitHub Actions summary table.The matrix also drives per-variant job name suffixes, gh-pages chart sub-paths, and S3 results sub-prefixes, so the two variants don't collide.
New
.github/actions/scripts/render-mem-summary.shthat renders a Markdown table to$GITHUB_STEP_SUMMARYwith per-test peak RSS, the limit, a breach flag, and peak reserved memory per area/kind. Gated onmatrix.variant == 'mem-limited'.Shared benchmark scripts (
fs_bench.sh,fs_cache_bench.sh) are now parameterised via theS3_MAX_MEMORY_TARGET_MIBenv variable. When set, they:--features mem_limiter.--max-memory-target=<N>.mount-s3-log-analyzerfor an additional JSON file via--mem-limit-mib=<N> --extra-metrics-out=<PATH>.When unset, behaviour is unchanged.
mount-s3-log-analyzergains two optional flags,--mem-limit-miband--extra-metrics-out, wired together withclap'srequiresso either both are set or neither. When both are set, the analyzer also parses Mountpoint metric log lines for:mem.bytes_reserved[area=prefetch]mem.bytes_reserved[area=upload]pool.reserved_bytes[kind=get_object]pool.reserved_bytes[kind=put_object]and writes JSON with the test name, peak RSS in MiB, memory limit in MiB, a `breached = peak_rss_mib
Example GitHub Actions summary
https://github.com/awslabs/mountpoint-s3/actions/runs/24720419069
Notes:
N/Aonly when Mountpoint never emitted it in the logs (e.g.pool.reserved_bytes[kind=get_object]in a write-only workload). If the metric was emitted with value 0, the column shows0.0._extra_metrics.jsonfile is consumed only by the memory summary step. It is not fed into the gh-pages benchmark charts.Where results are stored
Memory-limited results are stored under distinct
mem_limitedsub-paths so they don't collide with the existing charts:dev/bench/mem_limiteddev/bench/mem_limited/peak_mem_usagedev/cache_bench/mem_limiteddev/cache_bench/mem_limited/peak_mem_usagedev/s3-express/bench/mem_limiteddev/s3-express/bench/mem_limited/peak_mem_usageWhy a separate
_extra_metrics.json?The existing
<test>_peak_mem.jsonfollows the{name, value, unit}schema required bybenchmark-action/github-action-benchmarkand feeds the gh-pages charts. Adding more fields there would pollute the charts for non-memory-limited runs. Keeping the file separate lets each consumer (benchmark-action vs. GH Actions summary) receive only what it needs.Does this change impact existing behavior?
No - adding new benchmarks only.
Does this change need a changelog entry? Does it require a version change?
No.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).