Conversation
…ench Adds a syncwrite workload to the zfs-bench harness: a single writer issues an 8k pwrite then an fdatasync in a loop, recording per-op p50/p99, and threads=N runs N concurrent such writers on separate files. nofsync=1 drops the fdatasync to separate write-completion cost from durability cost. The single-writer form isolates the per-fsync cost with no lock contention to attribute it to. The concurrent form reproduces the WAL-commit-completion serialization a database hits under load without needing a database: N writers each fdatasync at once, and the diagnostic is whether aggregate throughput scales with N or plateaus. A plateau with the device and CPU both idle points at the completion/wakeup path rather than bandwidth. Signed-off-by: Greg Burd <greg@burd.me>
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.
bench: durable-write latency isolate with concurrent writers in zfs-bench
The
zfs-benchharness can measure throughput but not the per-operation cost of a durable write, which is the quantity a database's commit path actually pays. This adds asyncwriteworkload that measures it directly, plus a knob to decompose it.What it adds
syncwrite: a single-writer loop ofpwrite+fdatasync, reporting p50 and p99 for the durable write itself.threads=N: the same workload with N concurrent writers, so the per-operation cost can be observed under the contention a real commit path sees.nofsync=1: a control that runs the identical loop without thefdatasync, which separates the write cost from the durability cost.One file,
scripts/bench/zfs-bench.c. No kernel code, no build-system change, no test-manifest change. It builds with the existingscripts/bench/rebuild-bench.shline and links clean for OSv (no GLIBCXX/CXXABI/__isoc23references, which is the constraint for loading the.soin the guest).Why file it
This is the instrument that produced the measurements published in #1511 (the adaptive idle-spin window). That PR's table reports a busy-workload improvement and an idle-CPU comparison; without the harness in-tree a reviewer has no way to reproduce either number. Filing it makes #1511's evidence checkable rather than asserted, and gives the same decomposition (write cost vs durability cost, single vs concurrent) to anyone looking at the commit path later.
No performance claim is made here: this change only adds a measurement, it does not change any behavior.