From 7e33a89f8c067e343169925f15efd982747eeee6 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 16 Nov 2026 17:05:23 -0800 Subject: [PATCH 1/3] docs: report guest fsync after the group-commit fix (#173) The README, the agent-workspace diagram and docs/workspace-measurements.md still said guest fsync was about 7 ms against 3 ms local. A rerun after #173 (same lab pack and host, the same four setups, fio 4 KiB random write one at a time with fsync after every write, median of 3 boots) measured a median of 3.23 ms (ublk, walstore-chunk) against 2.74 ms local. The original runs stay as history in docs/workspace-measurements.md. Documentation only; no code changes. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/README.md | 22 +++++++----- .../assets/seaweed-block-agent-workspace.svg | 2 +- seaweed-block/docs/workspace-measurements.md | 34 +++++++++++++++---- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/seaweed-block/README.md b/seaweed-block/README.md index 17b80fd8b3..796ca20afb 100644 --- a/seaweed-block/README.md +++ b/seaweed-block/README.md @@ -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. diff --git a/seaweed-block/docs/assets/seaweed-block-agent-workspace.svg b/seaweed-block/docs/assets/seaweed-block-agent-workspace.svg index 6c0d6ba7cb..6cde2d5407 100644 --- a/seaweed-block/docs/assets/seaweed-block-agent-workspace.svg +++ b/seaweed-block/docs/assets/seaweed-block-agent-workspace.svg @@ -86,5 +86,5 @@ Measured on lab hosts: workloads in Firecracker microVMs; snapshot/fork in a host-side proxy (not an SLO) npm ci · git clone · untar · find+stat: same as a local disk snapshot 0.18 ms · fork 0.29 ms (10 GiB volume) · two-host lifecycle 35/35 - fsync: ~7 ms vs ~3 ms local today; ublk frontend and per-stage breakdown in progress + fsync (ublk): 3.2 ms vs 2.7 ms local · every guest fsync reaches the backend sync diff --git a/seaweed-block/docs/workspace-measurements.md b/seaweed-block/docs/workspace-measurements.md index 0a9e901765..7f03ff3dcd 100644 --- a/seaweed-block/docs/workspace-measurements.md +++ b/seaweed-block/docs/workspace-measurements.md @@ -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 one backend + `Sync` now takes about 1.2 ms. Each guest `fsync` causes two backend syncs. +- Every setup 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 From 806045889bc2545ad90e7cbe5881bf8e960cb6ed Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 16 Nov 2026 17:17:03 -0800 Subject: [PATCH 2/3] docs(measurements): say the backend Sync figure is a mean and which setups were gated The backend Sync figure is the mean over the gate window, and the gate that every guest fsync reaches the backend sync ran on the four Seaweed Block setups (not on the local disk). Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/workspace-measurements.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/seaweed-block/docs/workspace-measurements.md b/seaweed-block/docs/workspace-measurements.md index 7f03ff3dcd..8a532d684d 100644 --- a/seaweed-block/docs/workspace-measurements.md +++ b/seaweed-block/docs/workspace-measurements.md @@ -50,9 +50,9 @@ at a time, `fsync` after every write, 60 s; median of 3 boots per setup): (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 one backend - `Sync` now takes about 1.2 ms. Each guest `fsync` causes two backend syncs. -- Every setup passed a gate that every guest `fsync` reaches the backend sync + 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 From c380bf09839e1dec90388c131cb0e7f2d1ab2b54 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 16 Nov 2026 19:15:17 -0800 Subject: [PATCH 3/3] docs(design): update the fsync figures after the group-commit fix (#173) agent-workspace-design.md (measured results) adds the post-#173 guest fsync medians; block-design.md's known-issues entry says #173 removed the idle group-commit wait (about 5.5 ms to 3.23 ms against 2.74 ms local) and keeps the remaining lead (the checkpoint superblock fsync under the store lock). Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/design/agent-workspace-design.md | 2 +- seaweed-block/docs/design/block-design.md | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/seaweed-block/docs/design/agent-workspace-design.md b/seaweed-block/docs/design/agent-workspace-design.md index ca073faaa3..f3e9cbfcdd 100644 --- a/seaweed-block/docs/design/agent-workspace-design.md +++ b/seaweed-block/docs/design/agent-workspace-design.md @@ -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. diff --git a/seaweed-block/docs/design/block-design.md b/seaweed-block/docs/design/block-design.md index 21912bbebc..f9ffb3eef3 100644 --- a/seaweed-block/docs/design/block-design.md +++ b/seaweed-block/docs/design/block-design.md @@ -377,9 +377,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.