bench: harden benchmark validity and capture topology and attribution findings#604
Open
bench: harden benchmark validity and capture topology and attribution findings#604
Conversation
310ef66 to
e8fd769
Compare
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
This PR turns the benchmark branch into a validity-gated investigation across both engine and surface layers.
It now does seven things:
swmr_gb_scale_mixedbenchmark so the reported1 GBnumbers are correctness-checkedswmr_gb_scale_mixedso foreground writer cost is broken down instead of inferred from end-to-end latency alonesurface_open_and_fresh_readbenchmark to measure snapshot/open, selective HEAD reads, foreground write, and write-to-visible follow-up behaviortonbo-io/fusio#269What Changed
SWMR validity hardening
swmr_gb_scale_mixednow records per-reader expectations:head_light:count_and_key_bandhead_heavy,pinned_light,pinned_heavy:exact_shape_stablesnapshot_at(latest_manifest_version.timestamp)Standard-S3 benchmark hardening
benches/compaction/run_matrix.shto run local / S3 matrix cells and emit a report stubread_compaction_quiescedsetup so the benchmark reopens a fresh measurement DB and waits until it sees the expected visible row count before accepting the runS3 Express enablement and benchmark wiring
On top of Fusio PR
tonbo-io/fusio#269, this branch now:S3Spec.s3_expressspec.s3_expressinto the separate object-store FS used for snapshot / cleanup metadata walkingThat last harness fix matters because the initial failing benchmark path was not the core DB path. It was the metadata walk rebuilding an S3 client without Express mode and then hitting the real Express endpoint with the wrong signing flow.
Local write-path attribution
The branch now also records a local attribution pass for the foreground writer path used by
swmr_gb_scale_mixed.That adds:
~1 GBwriter-path breakdownFirst surface benchmark
The branch now also adds a first narrow
surfacebenchmark:surface_open_and_fresh_readbegin_snapshotas a first-pass open/snapshot costread_compaction_quiesced, but is still not a filesystem benchmarkKey Findings
Same-host EC2 local vs standard S3
On the same EC2 instance in
eu-central-1:local, scale=128.88 ms29.30 ms24,576standard S3, scale=1747.19 ms793.70 ms24,576local, scale=481.18 ms82.58 ms24,576standard S3, scale=41263.28 ms1284.84 ms24,576Observed ratio:
scale=1mean:25.9xscale=1p95:27.1xscale=4mean:15.6xscale=4p95:15.6xInterpretation:
scale=4zero-row artifact was a benchmark-harness acceptance bug, not a demonstrated generic reopen/read bug in TonboSame-host EC2 SWMR
1 GBOn the same EC2 instance at
~1 GBlogical state:local, ~1 GB logical0.2110.28337.57 Krows/s0.1480.00760.03560.00280.0176standard S3, ~1 GB logical9.64211.950823 rows/s5.8400.8871.6170.2751.022Observed ratio:
45.7x39.5xhead_light:117.3xhead_heavy:45.4xpinned_light:99.6xpinned_heavy:58.1xInterpretation:
~1 GB1 GBartifacts are correctness-valid, so these are usable comparison numbersLocal writer-path attribution at
~1 GBFor
swmr_gb_scale_mixedat~1 GB logicalon the local backend, the profiled foreground writer path breaks down as:229.18 msappend + commit):218.31 ms109.17 ms60.04 ms4.89 msInterpretation:
First surface benchmark follow-up
The first local vs standard-S3 comparison for
surface_open_and_fresh_readshows that the severe object-store penalty is not limited to the earlier compaction-focused engine cell.14.08 ms11.321 s804xbegin_snapshot0.87 ms534.87 ms613x2.91 ms2.921 s1004x5.68 ms3.746 s659x1.86 ms1.207 s649x4.60 ms4.118 s894xRead-path split in the object-store surface run:
2919.80 ms0.78 ms3742.38 ms3.48 ms2910.10 ms0.49 msInterpretation:
S3 Express same-host same-region follow-up
The branch now also contains the first directly comparable same-host runs between standard S3 and S3 Express in
us-east-1, with the EC2 runner in AZ IDuse1-az6matching the directory bucket.read_compaction_quiesced scale=1mean873.05 ms2278.97 ms2.61xslowerread_compaction_quiesced scale=1p951263.49 ms2621.39 ms2.07xslowerread_compaction_quiesced scale=4mean2478.59 ms4071.72 ms1.64xslowerread_compaction_quiesced scale=4p952768.13 ms4264.24 ms1.54xslowerswmr_gb_scale_mixed ~1 GBmean step11.644 s40.162 s3.45xslowerswmr_gb_scale_mixed ~1 GBp95 step13.747 s42.338 s3.08xslowerswmr_gb_scale_mixed ~1 GBthroughput681.57 rows/s197.60 rows/s3.45xlowerswmr_gb_scale_mixed ~1 GBwriter mean7.571 s21.575 s2.85xslowerImportant debug result:
FUSIO_S3_EXPRESS_DEBUG=1logged exactly1CreateSession0Interpretation:
1 GBpreload time:699.734 s2331.777 sConclusion
This branch now supports three design conclusions.
WAL(disk) -> later S3 publishorWAL(disk) -> stream pipeline -> eventual S3 persistence. Direct object-store WAL may still be necessary for environments without a filesystem, but the current path looks too expensive as the general case.What this branch still does not prove:
Result Notes
Checked-in notes that support the branch story:
swmr_gb_scale_2026-03-27.md: pinned-snapshot root causeswmr_gb_scale_2026-03-28.md: move from non-empty checks to shape validationswmr_gb_scale_2026-03-29.md: first valid object-store1 GBSWMR evidencecompaction_topology_2026-03-30.md: first local vs S3 topology pass and original brokenscale=4stateec2_same_host_topology_2026-03-31.md: final same-host EC2 local vs standard-S3 comparisonec2_s3_express_cross_region_2026-04-01.md: first successful cross-region Express enablement runsec2_use1_same_region_2026-04-01.md: same-host same-region standard-S3 vs Express comparisonswmr_write_path_attribution_2026-04-14.md: local writer-path attribution for the~1 GBSWMR benchmarkValidation
Ran across this branch work:
cargo testcargo clippy --all-targets -- -D warningscargo +nightly fmt --allcargo bench -p tonbo --bench compaction_local --no-run1 GBrerunsFUSIO_S3_EXPRESS_DEBUG=1swmr_gb_scale_mixedsurface_open_and_fresh_readRelated
tonbo-io/fusio#269