Merge pull request #185 from seaweedfs/docs/m5-fsync-numbers

docs: report guest fsync after the group-commit fix (#173)
This commit is contained in:
Ping Qiu authored and GitHub committed 2026-11-16 19:36:44 -08:00
commit c5a7f062a0
5 files changed
+45 -19

No files matched your search

+14 -8
View File
@@ -62,21 +62,26 @@ read-only status (stale evidence is `Ready=Unknown`, never a false ready).
Lab runs, median of 3; not SLOs. Workloads: Firecracker microVMs (4 vCPU,
4 GiB) on one bare-metal host over NVMe/TCP loopback, against a local
file-backed disk. Snapshot and fork: a host-side proxy without network
latency, guest `fsync` or the block frontend.
file-backed disk. The two `fsync` rows marked "ublk" come from a later run on
the same host with the ublk frontend, after the group-commit fix
([#173](https://github.com/seaweedfs/seaweed-block/pull/173)). Snapshot and
fork: a host-side proxy without network latency, guest `fsync` or the block
frontend.
| Measurement | Seaweed Block | Local disk |
|---|---|---|
| `npm ci` (617 packages, offline) / `git clone` (Go 1.23, local) | 2.14 s / 7.10 s | 2.14 s / 6.99 s |
| Untar 100,000 files / cold `find` + `stat` over them | 1.10 s / 0.32 s | 1.06 s / 0.33 s |
| 2,000 × create + write + `fsync` | 14.33 s | 6.09 s |
| 2,000 × create + write + `fsync` (ublk) | 8.48 s | 6.11 s |
| Guest `fsync` median, fio 4 KiB random write, one at a time (ublk) | 3.23 ms | 2.74 ms |
| Snapshot / fork of a 10 GiB volume (2,560 chunks) | 0.18 ms / 0.29 ms | |
| Two-host lifecycle: create, snapshot, fork, move, stale holder, delete, GC | 35 of 35 checks | |
Metadata-heavy workloads run at local-disk speed. The cost in these runs is
`fsync` latency, about 7 ms against 3 ms local, measured with the NVMe/TCP
loopback frontend. The ublk frontend and per-stage `fsync` histograms are on
`main` now; latency improvement is in progress.
Metadata-heavy workloads run at local-disk speed. The remaining cost is
`fsync`: a median of 3.23 ms against 2.74 ms local with the ublk frontend
(3.59 ms over NVMe/TCP loopback), down from about 7 ms before the group-commit
fix. Every guest `fsync` still reaches the backend sync; no write cache is
turned off to get there.
[Workspace measurements](docs/workspace-measurements.md) has every number and
how each was measured.
@@ -180,7 +185,8 @@ run evidence: [release notes](docs/releases/README.md).
### Not claimed yet
- Production readiness, SLOs, or a published performance, RTO or RPO claim.
- `fsync` parity with local disk (in progress, see Measured results).
- `fsync` parity with local disk. Today it is about 1.2× local (see Measured
results).
- ublk at high density. Unprivileged per-volume servers need a privileged
control broker, which is not done.
- Crash-restart recovery of a ublk server. A crashed server fails closed.
@@ -86,5 +86,5 @@
<text x="70" y="474" font-size="14" font-weight="700" fill="#e2e8f0">Measured on lab hosts: workloads in Firecracker microVMs; snapshot/fork in a host-side proxy (not an SLO)</text>
<text x="70" y="502" font-size="13" fill="#cbd5e1">npm ci · git clone · untar · find+stat: same as a local disk</text>
<text x="560" y="502" font-size="13" fill="#cbd5e1">snapshot 0.18 ms · fork 0.29 ms (10 GiB volume) · two-host lifecycle 35/35</text>
<text x="70" y="522" font-size="12" fill="#94a3b8">fsync: ~7 ms vs ~3 ms local today; ublk frontend and per-stage breakdown in progress</text>
<text x="70" y="522" font-size="12" fill="#94a3b8">fsync (ublk): 3.2 ms vs 2.7 ms local · every guest fsync reaches the backend sync</text>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

@@ -307,7 +307,7 @@ Not done yet:
Measurements, not SLOs; each is the median of 3 runs. [Workspace measurements](../workspace-measurements.md) has every number and how it was measured.
- **Workloads** (Firecracker microVMs, 4 vCPU, 4 GiB, one bare-metal host, NVMe/TCP loopback): metadata-heavy agent workloads (`npm ci`, `git clone`, untar, `find` + `stat`) ran at local-disk speed. The cost is `fsync` latency: 2,000 × create + write + `fsync` took 14.33 s against 6.09 s on a local disk, about 7 ms against 3 ms per `fsync`. Reducing it is in progress; the per-stage histograms are described in [fsync latency](../fsync-latency.md).
- **Workloads** (Firecracker microVMs, 4 vCPU, 4 GiB, one bare-metal host, NVMe/TCP loopback): metadata-heavy agent workloads (`npm ci`, `git clone`, untar, `find` + `stat`) ran at local-disk speed. The cost was `fsync` latency: 2,000 × create + write + `fsync` took 14.33 s against 6.09 s on a local disk, about 7 ms against 3 ms per `fsync`. After the group-commit fix (#173), guest `fsync` is a median of 3.23 ms against 2.74 ms local with the ublk frontend (3.59 ms over NVMe/TCP loopback); [workspace measurements](../workspace-measurements.md) has both rounds. The per-stage histograms are described in [fsync latency](../fsync-latency.md).
- **Snapshot and fork** (host-side proxy, a 10 GiB volume of 2,560 chunks, no network latency, guest `fsync` or block frontend): HEAD root 2,172 bytes; snapshot 0.18 ms; fork 0.29 ms (flat manifest: 261,531 bytes, 5.79 ms, 10.67 ms).
- **Cut upload** (same proxy): 64 dirty chunks (256 MiB) in 624 ms with one upload at a time, 434 ms with 8 in parallel.
- **Two-host lifecycle** (Firecracker VMs, SeaweedFS chunk backend): create, write, two snapshots, fork, clean move, stale-holder replay refused, delete, GC; 35 of 35 checks passed, GC reclaimed 38 of 38 candidates and every reclaimed chunk returned 404.
+1 -3
View File
@@ -379,9 +379,7 @@ These are tracked for fixes. Most were raised by an independent review of this r
- **NVMe/TCP H2CData offset overflow.** The `DATAO + length` bound check is done in 32-bit arithmetic and can wrap, so one malformed PDU can panic the process (`core/frontend/nvme/session.go` `recvH2CData`). Reachable from loopback by default. **Planned fix:** 64-bit arithmetic, offset and R2T consistency checks, and bounds on wire-supplied allocations.
- **Process notes in source comments.** #162 removed reviewer names and decision timestamps from code comments. A few comments still cite internal review labels (for example "ruling F1") where a neutral design rationale would be clearer.
- **fsync latency (about 7 ms against 3 ms local).** Leads to measure with the `/status/durable` histograms:
- the group committer waits a full 1 ms unless 64 waiters are queued, so at queue depth 1 every `fsync` pays at least 1 ms;
- the checkpoint superblock `fsync` runs under the exclusive store lock, stalling reads and writes each flush cycle.
- **fsync latency.** #173 removed the idle group-commit wait: a lone `Sync` no longer waits out the collection delay, and guest `fsync` fell from about 5.5 ms to a median of 3.23 ms against 2.74 ms local (ublk; see [workspace measurements](../workspace-measurements.md)). Remaining lead: the checkpoint superblock `fsync` runs under the exclusive store lock, stalling reads and writes each flush cycle.
- **smartwal crash window.** A crash between the in-place write and the ring append can leave the volume unopenable (§1.3). smartwal is experimental and not a default: standalone `blockvolume` creates new volumes as walstore (auto), and Kubernetes and workspaces use walstore. **Planned:** fix the ordering.
- **Forged records in user data.** WAL records are not bound to a store incarnation or lap, so bytes inside user data that happen to decode as a valid record could be replayed by the defensive scan. **Planned:** an incarnation nonce and lap in the next format, plus a clean-shutdown marker in the meantime.
- **Mid-history WAL corruption only warns** (§1.2 step 2). Fixing it needs the synced watermark in the next format.
+28 -6
View File
@@ -28,15 +28,37 @@ bare-metal host; NVMe/TCP loopback; seconds):
kernel absorbs metadata and the block device only sees batched writes.
- Every guest `fsync` was verified to reach the backend sync: about 2 NVMe
flushes per `fsync`, and zero in an unsafe-cache control.
- The cost in these runs is `fsync` latency, about 7 ms against 3 ms local.
The runs used the NVMe/TCP loopback frontend. The ublk frontend
(`--ublk-device`) and the per-stage `fsync` histograms (`/status/durable`,
see [fsync latency](fsync-latency.md)) are on `main` now; reducing the
latency, including group-commit tuning, is in progress. The numbers here
record those runs, not a measurement of current `main`.
- The cost in these runs was `fsync` latency, about 7 ms against 3 ms local,
over the NVMe/TCP loopback frontend. These are the original runs, kept as
history; the next section measures `fsync` after the group-commit fix.
- The same comparison on an Azure `D16s_v5` nested-virtualization host gives
the same picture.
**`fsync` after the group-commit fix** ([#173](https://github.com/seaweedfs/seaweed-block/pull/173);
one bare-metal lab host; Firecracker guest; fio 4 KiB random write, one request
at a time, `fsync` after every write, 60 s; median of 3 boots per setup):
| Setup | `fsync` p50 | `fsync` p99 | Write IOPS | 2,000 × create + write + `fsync` |
|---|---|---|---|---|
| ublk, `walstore-chunk` | 3.23 ms | 9.11 ms | 283 | 8.48 s |
| ublk, `smartwal` (experimental) | 3.26 ms | 5.21 ms | 299 | 8.29 s |
| NVMe/TCP loopback, `walstore-chunk` | 3.59 ms | 9.63 ms | 258 | 9.27 s |
| NVMe/TCP loopback, `smartwal` (experimental) | 3.59 ms | 7.57 ms | 263 | 8.68 s |
| Local file-backed disk | 2.74 ms | 4.42 ms | 357 | 6.11 s |
- Before the fix, on the same pack and host, guest `fsync` p50 was 5.54 ms
(ublk) and 5.87 ms (NVMe/TCP) against 2.74 ms local.
- The fix removed an idle wait: a lone `Sync` used to sit out the group-commit
collection delay with nobody to batch with. On `walstore-chunk` the
group-commit wait fell to about 8 µs (histogram p50 bucket), and a backend
`Sync` now takes about 1.2 ms on average (mean over the gate window). Each guest `fsync` causes two backend syncs.
- All four Seaweed Block setups passed a gate that every guest `fsync` reaches the backend sync
(at least 2,000 flushes and 2,000 backend syncs per run); an unsafe-cache
control showed zero.
- The other workloads (`npm ci`, `git clone`, untar, `find` + `stat`) stayed at
local-disk speed.
- One time window, 3 runs per setup: descriptive, not a performance gate.
**Snapshot and fork cost** (a 10 GiB volume written as 2,560 chunks of 4 MiB;
median of 3). This is a host-side proxy, not a guest or network run: chunks are
local files on a native Linux host, and filer metadata calls use a