From 60abd75d70dffd9355332c53708aa2cc3071fad4 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:20:59 -0800 Subject: [PATCH 1/7] docs: hero diagram, measured-results chart, FUSE and fault-injection records The hero shows the write path (acknowledged on the local WAL) and the background path (cuts to SeaweedFS, HEAD conditional update), with light and dark colours. The chart is drawn from a checked-in CSV by scripts/readme-chart.py (--check fails when an SVG is stale). workspace-measurements.md gains the same run against a FUSE file system on the same host and the release candidate's fault-injection durability count. Co-Authored-By: Claude Opus 5.5 --- .../docs/assets/measured-results-dark.svg | 41 ++++ .../docs/assets/measured-results-light.svg | 41 ++++ .../docs/assets/measured-results.csv | 7 + .../docs/assets/seaweed-block-hero.svg | 194 +++++++++--------- seaweed-block/docs/workspace-measurements.md | 33 ++- seaweed-block/scripts/readme-chart.py | 119 +++++++++++ 6 files changed, 339 insertions(+), 96 deletions(-) create mode 100644 seaweed-block/docs/assets/measured-results-dark.svg create mode 100644 seaweed-block/docs/assets/measured-results-light.svg create mode 100644 seaweed-block/docs/assets/measured-results.csv create mode 100644 seaweed-block/scripts/readme-chart.py diff --git a/seaweed-block/docs/assets/measured-results-dark.svg b/seaweed-block/docs/assets/measured-results-dark.svg new file mode 100644 index 0000000000..c978e32100 --- /dev/null +++ b/seaweed-block/docs/assets/measured-results-dark.svg @@ -0,0 +1,41 @@ + +Workload time on Seaweed Block relative to a local disk +npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.39 times local (8.48 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.18 times local (3.23 ms against 2.74 ms) + +Time on Seaweed Block relative to a local disk (local disk = 1.0) +Lab runs, median of 3, not SLOs. Lower is faster. + +0.0 + +0.5 + +1.0 + +1.5 + +local disk +npm ci (617 packages; offline) +NVMe/TCP loopback +npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) +1.00x (2.14 s / 2.14 s) +git clone (Go 1.23; local) +NVMe/TCP loopback +git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) +1.02x (7.10 s / 6.99 s) +Untar 100,000 files +NVMe/TCP loopback +Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) +1.04x (1.10 s / 1.06 s) +Cold find + stat over them +NVMe/TCP loopback +Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) +0.97x (0.32 s / 0.33 s) +2000 x create + write + fsync +ublk +2000 x create + write + fsync: 1.39 x local (8.48 s against 6.11 s) +1.39x (8.48 s / 6.11 s) +Guest fsync median (fio 4 KiB) +ublk +Guest fsync median (fio 4 KiB): 1.18 x local (3.23 ms against 2.74 ms) +1.18x (3.23 ms / 2.74 ms) + diff --git a/seaweed-block/docs/assets/measured-results-light.svg b/seaweed-block/docs/assets/measured-results-light.svg new file mode 100644 index 0000000000..760204f6f8 --- /dev/null +++ b/seaweed-block/docs/assets/measured-results-light.svg @@ -0,0 +1,41 @@ + +Workload time on Seaweed Block relative to a local disk +npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.39 times local (8.48 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.18 times local (3.23 ms against 2.74 ms) + +Time on Seaweed Block relative to a local disk (local disk = 1.0) +Lab runs, median of 3, not SLOs. Lower is faster. + +0.0 + +0.5 + +1.0 + +1.5 + +local disk +npm ci (617 packages; offline) +NVMe/TCP loopback +npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) +1.00x (2.14 s / 2.14 s) +git clone (Go 1.23; local) +NVMe/TCP loopback +git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) +1.02x (7.10 s / 6.99 s) +Untar 100,000 files +NVMe/TCP loopback +Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) +1.04x (1.10 s / 1.06 s) +Cold find + stat over them +NVMe/TCP loopback +Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) +0.97x (0.32 s / 0.33 s) +2000 x create + write + fsync +ublk +2000 x create + write + fsync: 1.39 x local (8.48 s against 6.11 s) +1.39x (8.48 s / 6.11 s) +Guest fsync median (fio 4 KiB) +ublk +Guest fsync median (fio 4 KiB): 1.18 x local (3.23 ms against 2.74 ms) +1.18x (3.23 ms / 2.74 ms) + diff --git a/seaweed-block/docs/assets/measured-results.csv b/seaweed-block/docs/assets/measured-results.csv new file mode 100644 index 0000000000..39103d5bc5 --- /dev/null +++ b/seaweed-block/docs/assets/measured-results.csv @@ -0,0 +1,7 @@ +workload,seaweed_block,local_disk,unit,frontend +npm ci (617 packages; offline),2.14,2.14,s,NVMe/TCP loopback +git clone (Go 1.23; local),7.10,6.99,s,NVMe/TCP loopback +"Untar 100,000 files",1.10,1.06,s,NVMe/TCP loopback +Cold find + stat over them,0.32,0.33,s,NVMe/TCP loopback +2000 x create + write + fsync,8.48,6.11,s,ublk +Guest fsync median (fio 4 KiB),3.23,2.74,ms,ublk diff --git a/seaweed-block/docs/assets/seaweed-block-hero.svg b/seaweed-block/docs/assets/seaweed-block-hero.svg index 6c2ba3f7fe..8196437164 100644 --- a/seaweed-block/docs/assets/seaweed-block-hero.svg +++ b/seaweed-block/docs/assets/seaweed-block-hero.svg @@ -1,105 +1,111 @@ - - Seaweed Block: one block service core, two uses - A shared core (blockvolume with ublk, NVMe/TCP and iSCSI frontends, one Read/Write/Sync backend contract and the walstore WAL engine, plus blockmaster as the epoch authority) serves two uses: agent microVM disks that cut changed chunks to SeaweedFS for snapshots, forks and host moves, and Kubernetes PVCs through CSI, RF=1 by default with optional RF=2 or RF=3 replication. + + Seaweed Block: the write path and the background path + Left, the write path: an agent sandbox or microVM writes to a plain virtio block disk; ublk or NVMe/TCP carries the request to blockvolume, which completes the write and fsync on its local WAL and acknowledges. Nothing on this path waits on the network. Right, the background path: a cut, on a schedule, at a snapshot or at detach, uploads only the changed 4 MiB chunks to your SeaweedFS and then updates the volume's HEAD root with a conditional update on generation and epoch. A snapshot names a root and shares its chunks; a restore makes a new volume that reads chunks on first use; a move lets another host take over at a higher epoch, and a stale holder's update is refused. Above both, blockmaster issues epochs and leases. The same core serves Kubernetes volumes through the CSI driver (alpha). + - - - - - - - - - + + + - + + Seaweed Block + Local-disk speed on the write path; snapshots, restore and moves through your SeaweedFS in the background. - Seaweed Block - One block service core · two uses: agent workspace disks and Kubernetes block volumes + + + blockmaster: the epoch authority + assigns each volume's holder · issues epochs and leases - - AGENT WORKSPACE DISKS - · proof of concept - - agent microVM - /dev/vda · ext4 - one local-speed disk per sandbox + + + + + WRITE PATH (synchronous) + + BACKGROUND PATH (cuts) - - KUBERNETES BLOCK VOLUMES - · alpha - - app pod + PVC - blockcsi: provision, attach, mount - Helm chart · read-only status + + + agent sandbox or microVM + a plain virtio block disk + + + ublk or NVMe/TCP + + + blockvolume (one per volume) + + + local WAL + extent + walstore, on the host's disk + + + nothing on this path + waits on the network + ack (left arrow) + write and fsync complete + on the local WAL - - - Shared core + + + cut + on a schedule, at a snapshot, at detach + + + only the changed 4 MiB chunks + + + your SeaweedFS + + + HEAD root (about 2 KB) + conditional update on {gen, epoch} + + snapshot + names a root; chunks are shared + restore + a new volume that reads the + snapshot's chunks on first use + move + another host takes over at a + higher epoch; a stale holder's + HEAD update is refused - - blockvolume - one process per volume replica + + - - ublk - - NVMe/TCP - - iSCSI + + + epoch, lease + + epoch fencing - one Backend contract: Read · Write · Sync - - - local WAL engine: walstore - WAL + extent · group fsync · typed recovery reasons - - - - blockmaster · epoch authority - assignments · epochs · leases · epoch fencing - - - - virtio-blk - - iSCSI or - NVMe/TCP - - - - SeaweedFS - - HEAD root (~2 KB) - conditional update on {gen, epoch} - - - - - - - - - immutable 4 MiB chunks, shared - snapshot / fork = copy the root - resume on another host at epoch + 1 - - - cut - changed - chunks - - - - Optional replicas (RF=2 / 3) - ship by LSN · durable barrier - best_effort · sync_quorum · sync_all - catch-up or rebuild · epoch-fenced - - - replicate - - - Workspace disks run one local replica; durability comes from cuts to SeaweedFS. Kubernetes volumes default to RF=1; synchronous RF=2 or RF=3 is opt-in (supported lab). + + The same core serves Kubernetes volumes through the CSI driver (iSCSI or NVMe/TCP; alpha in v1.0.0). diff --git a/seaweed-block/docs/workspace-measurements.md b/seaweed-block/docs/workspace-measurements.md index 8a532d684d..9c9ed24af9 100644 --- a/seaweed-block/docs/workspace-measurements.md +++ b/seaweed-block/docs/workspace-measurements.md @@ -34,6 +34,23 @@ bare-metal host; NVMe/TCP loopback; seconds): - The same comparison on an Azure `D16s_v5` nested-virtualization host gives the same picture. +**The same workloads against a FUSE file system on the same host** (same run, +`swbd0a-r5`, 2026-11-15; the FUSE file system ran on the same bare-metal host; +seconds, median of 3): + +| Workload | Seaweed Block | FUSE file system | FUSE / Seaweed Block | +|---|---|---|---| +| `npm ci` (617 packages, offline) | 2.14 | 11.81 | 5.5× | +| `git clone` (Go 1.23 repository, local) | 7.10 | 37.09 | 5.2× | +| Untar 5,000 files | 0.31 | 19.28 | 62× | +| Untar a 100,000-file tree | 1.10 | 47.54 | 43× | +| 2,000 × create + write + `fsync` | 14.33 | 14.32 | 1.0× | + +- Metadata-heavy work was 5 to 62 times faster on the block disk; `fsync`-bound + work took the same time on both. +- The cold `find` + `stat` row has no FUSE equivalent in this run (the FUSE + runs measured a first and a second pass instead), so it is left out. + **`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): @@ -88,6 +105,18 @@ In the same proxy, a cut that writes 64 dirty chunks (256 MiB) took a median - Everything still referenced read back byte-identical, including the moved workspace's digest before and after GC. -These results cover the chunk path (`walstore-chunk`), which is a proof of -concept: not yet a default, a release claim or a production path. The +**Fault injection on the release candidate** (v1.0.0-rc.3, 2026-11-28; five +runs on one lab host; each run injected a process kill during a snapshot, a +kill during a write, and a pause of the object store during a snapshot): + +- The durability checker judged 253 writes across the five runs: acknowledged + writes lost = 0, and writes of unknown outcome landing after a + later durable write = 0. +- The same night failed other checks of operation outcomes (snapshot, move and + restore results, including one restore whose outcome stayed unresolved). + They are not data loss and are not counted here. + +The lifecycle run above predates v1.0.0. In v1.0.0 the chunk path +(`walstore-chunk`) is the supported single-replica configuration; see the +[v1.0.0 release note](releases/v1.0.0.md). The [agent workspace design](design/agent-workspace-design.md) describes how it works. diff --git a/seaweed-block/scripts/readme-chart.py b/seaweed-block/scripts/readme-chart.py new file mode 100644 index 0000000000..d60e166703 --- /dev/null +++ b/seaweed-block/scripts/readme-chart.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 +"""Draw the README's measured-results chart from docs/assets/measured-results.csv. + +Each workload's time on Seaweed Block is shown relative to the same workload on +a local disk (local disk = 1.0), so rows with different units share one axis. +Writes a light and a dark SVG next to the CSV. With --check, it writes nothing +and exits 1 if either SVG differs from what the CSV gives. + +usage: python3 scripts/readme-chart.py [--check] +""" +import csv +import sys +from pathlib import Path +from xml.sax.saxutils import escape + +ROOT = Path(__file__).resolve().parent.parent +CSV = ROOT / "docs" / "assets" / "measured-results.csv" +OUT = {"light": ROOT / "docs" / "assets" / "measured-results-light.svg", + "dark": ROOT / "docs" / "assets" / "measured-results-dark.svg"} + +THEMES = { + "light": {"surface": "#fcfcfb", "ink": "#0b0b0b", "ink2": "#52514e", "grid": "#e4e3df", + "ref": "#52514e", "bar": "#2a78d6"}, + "dark": {"surface": "#1a1a19", "ink": "#f0efec", "ink2": "#c3c2b7", "grid": "#383835", + "ref": "#c3c2b7", "bar": "#3987e5"}, +} + +W, LABEL_W, RIGHT_W = 760, 250, 150 +ROW_H, BAR_H, TOP, BOTTOM = 34, 14, 56, 44 +XMAX = 1.5 +TICKS = [0.0, 0.5, 1.0, 1.5] + + +def rows(): + with CSV.open(encoding="utf-8", newline="") as f: + out = [] + for r in csv.DictReader(f): + sb, local = float(r["seaweed_block"]), float(r["local_disk"]) + out.append((r["workload"], sb, local, r["unit"], r["frontend"])) + return out + + +def fmt(v, unit): + return f"{v:.2f} {unit}" + + +def bar_path(x0, y, w, h, r=4): + """A bar anchored at x0 with a rounded data end (right side only).""" + r = min(r, w, h / 2) + x1 = x0 + w + return (f"M{x0:.1f},{y:.1f} H{x1 - r:.1f} Q{x1:.1f},{y:.1f} {x1:.1f},{y + r:.1f} " + f"V{y + h - r:.1f} Q{x1:.1f},{y + h:.1f} {x1 - r:.1f},{y + h:.1f} H{x0:.1f} Z") + + +def svg(theme): + t = THEMES[theme] + data = rows() + plot_w = W - LABEL_W - RIGHT_W + h = TOP + ROW_H * len(data) + BOTTOM + + def x(v): + return LABEL_W + plot_w * v / XMAX + + parts = [ + f'', + 'Workload time on Seaweed Block relative to a local disk', + '' + escape("; ".join( + f"{w}: {sb / lo:.2f} times local ({fmt(sb, u)} against {fmt(lo, u)})" for w, sb, lo, u, _ in data)) + '', + f'', + f'' + 'Time on Seaweed Block relative to a local disk (local disk = 1.0)', + f'' + 'Lab runs, median of 3, not SLOs. Lower is faster.', + ] + for v in TICKS: + parts.append(f'') + parts.append(f'{v:.1f}') + parts.append(f'') + parts.append(f'local disk') + for i, (w, sb, lo, u, fe) in enumerate(data): + yc = TOP + ROW_H * i + ROW_H / 2 + ratio = sb / lo + parts.append(f'{escape(w)}') + parts.append(f'{escape(fe)}') + parts.append(f'{escape(w)}: {ratio:.2f} x local ' + f'({fmt(sb, u)} against {fmt(lo, u)})') + parts.append(f'' + f'{ratio:.2f}x ' + f'({fmt(sb, u)} / {fmt(lo, u)})') + parts.append("") + return "\n".join(parts) + "\n" + + +def main(): + check = sys.argv[1:] == ["--check"] + stale = [] + for theme, path in OUT.items(): + text = svg(theme) + if check: + if not path.exists() or path.read_text(encoding="utf-8") != text: + stale.append(str(path.relative_to(ROOT))) + else: + path.write_text(text, encoding="utf-8", newline="\n") + if stale: + print("stale, rerun scripts/readme-chart.py: " + ", ".join(stale)) + return 1 + return 0 + + +if __name__ == "__main__": + sys.exit(main()) From b1b08135e5c6516001943508e51ce90dd1c4ddc9 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:22:34 -0800 Subject: [PATCH 2/7] docs(readme): rewrite: pitch, two-path diagram, why, chart, comparison The page leads with what the product is for and a diagram of the write path and the background path; install and the first check come next; then why (each point linked to its evidence), the measured chart and table, a comparison by design category, and status and limits. The remaining sections are kept as they were. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/README.md | 171 +++++++++++++------------- seaweed-block/scripts/readme-chart.py | 2 +- 2 files changed, 86 insertions(+), 87 deletions(-) diff --git a/seaweed-block/README.md b/seaweed-block/README.md index e8f4290760..d229dae915 100644 --- a/seaweed-block/README.md +++ b/seaweed-block/README.md @@ -1,93 +1,19 @@ # Seaweed Block -Block storage written in Go: a local-speed block device whose ownership is -fenced by epochs. It serves agent workspace disks backed by -[SeaweedFS](https://github.com/seaweedfs/seaweedfs) snapshots, and Kubernetes -block volumes (alpha). +[![tag](https://img.shields.io/github/v/tag/seaweedfs/seaweed-block?sort=semver&label=release)](docs/releases/v1.0.0.md) +[![CI](https://github.com/seaweedfs/seaweed-block/actions/workflows/test.yml/badge.svg)](https://github.com/seaweedfs/seaweed-block/actions/workflows/test.yml) +[![Go](https://img.shields.io/github/go-mod/go-version/seaweedfs/seaweed-block)](go.mod) +[![License](https://img.shields.io/github/license/seaweedfs/seaweed-block)](LICENSE) + +**Block storage for AI agent workspaces at local-disk speed, with snapshots, restore and moves backed by your own +[SeaweedFS](https://github.com/seaweedfs/seaweedfs).** Each sandbox or microVM gets a plain virtio block disk. Writes +and `fsync` complete on the host's local disk; changed data goes to SeaweedFS in the background. The same core serves +Kubernetes block volumes (alpha).

- Seaweed Block: a shared core (blockvolume with ublk, NVMe/TCP and iSCSI frontends and the walstore WAL engine, plus blockmaster as the epoch authority) used for agent workspace disks with chunk snapshots in SeaweedFS and for Kubernetes PVCs, with optional RF=2 or RF=3 replication + Seaweed Block. Write path: an agent sandbox or microVM writes over ublk or NVMe/TCP to blockvolume, which completes the write and fsync on its local WAL and acknowledges; nothing on this path waits on the network. Background path: a cut, on a schedule, at a snapshot or at detach, uploads only the changed 4 MiB chunks to your SeaweedFS, then updates the HEAD root with a conditional update on generation and epoch. blockmaster issues epochs and leases. Snapshots name a root and share chunks; a restore reads the snapshot's chunks on first use; a move hands the volume to another host at a higher epoch, and a stale holder's update is refused.

-## What it is - -| | Agent workspace disks | Kubernetes block volumes | -|---|---|---| -| Consumer | an agent sandbox or microVM, as a plain virtio block device | an app pod, through a PVC and the CSI driver | -| Frontend | NVMe/TCP loopback or ublk | iSCSI, or NVMe/TCP (source-gated) | -| Durability | one local replica, with cuts to SeaweedFS | RF=1 with best-effort ack by default; synchronous RF=2 or RF=3 (`sync-quorum`, `sync-all`) when configured, in a supported lab | -| Maturity | v1.0.0, single replica | alpha | - -Both uses share one core. `blockvolume` serves one volume replica; its -frontends turn block requests into a single Read / Write / Sync contract, and -`Sync` is the only durability point. Writes land in a local WAL engine, -`walstore` (a WAL plus an extent). `blockvolume --durable-impl` defaults to -auto: a new volume is created as `walstore` and an existing one opens with its -on-disk format; auto refuses a `walstore-chunk` root, which needs -`--durable-impl=walstore-chunk` with its remote configuration. `smartwal` is -experimental. `blockmaster` is the only component that mints epochs. Each -`blockvolume` admits I/O only while its local view of the assignment is -current: a deposed primary refuses I/O once it observes the new assignment or -a fence, or once its workspace lease expires. That is a local admission rule, -not an instant global revocation. Separately, every remote HEAD publish is a -conditional update on `{gen, epoch}`, so the store refuses a stale holder's -publish even before that holder notices it was replaced. The design is in -three documents: the [core design](docs/design/block-design.md), the [agent -workspace design](docs/design/agent-workspace-design.md) and the [Kubernetes -block design](docs/design/kubernetes-block-design.md). Each covers its parts, -their invariants, the tests behind them and the known issues. - -## Highlights - -**Agent workspace disks** - -- **Local-speed disk.** Writes and `fsync` complete against the local WAL; - nothing on the write path waits on the network. -- **Incremental snapshots.** A cut uploads only the changed 4 MiB chunks. - Chunks are immutable; the volume's state is a HEAD root of about 2 KB, and - every publish is a conditional update on `{gen, epoch}`. -- **Cheap snapshot and restore.** A snapshot copies only the HEAD root; chunks - are shared. A restore makes a new volume that reads the snapshot's chunks. - The holder's cleaning removes the chunks that no snapshot, restore target - or current image names; SeaweedFS vacuum then returns the space. -- **Move to any host.** Another host takes over with a higher epoch and fetches - chunks lazily on first read. A stale holder cannot publish. -- **Single replica by design.** Losing a host loses at most the writes since - the last cut. Cut at semantic points: after an agent step, before a risky - command, on detach. - -**Kubernetes block volumes (alpha)**: Helm install, dynamic PVCs, RF=3 -recovery gates in a supported lab, support-bundle replay, and negative-first -read-only status (stale evidence is `Ready=Unknown`, never a false ready). - -## Measured results - -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. 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)). For -the snapshot row: a host-side proxy without network latency, guest `fsync` or the block -frontend. The two-host lifecycle row is a pre-release run that included fork (removed -from this release) and the earlier GC. - -| 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` (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 of a 10 GiB volume (2,560 chunks) | 0.18 ms | | -| Two-host lifecycle (pre-release): create, snapshot, fork, move, stale holder, delete, GC | 35 of 35 checks | | - -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. - ## Install The binaries are `blockmaster`, `blockvolume` and the `sw-block` CLI. The commands on this page are for v1.0.0. @@ -119,6 +45,75 @@ not format or write the attached device; it only creates local backing files and logs. It needs Linux, bash, `nvme-cli`, `sudo` and the binaries above. To format and write, use the [write test](docs/standalone-deployment.md#write-test-scratch-host-only) (scratch host only). +## Why Seaweed Block + +- **Local-disk speed for agent work.** `npm ci`, `git clone` and untar run within 0-4% of a local disk; against a + FUSE file system on the same host, untar, `npm ci` and `git clone` were 5 to 62 times faster + ([measured results](#measured-results), [how each was measured](docs/workspace-measurements.md)). +- **`fsync` means durable.** Every guest `fsync` reaches the backend sync; no write cache is turned off to get the + speed (a gate counts flushes against backend syncs, with an unsafe-cache control). In fault injection on the + release candidate, 0 acknowledged writes were lost across 253 judged + ([records](docs/workspace-measurements.md)). +- **Snapshots in your object store.** A cut uploads only the changed 4 MiB chunks. A snapshot names a root of about + 2 KB and shares its chunks; a restore makes a new volume that reads them on first use + ([agent workspace design](docs/design/agent-workspace-design.md)). +- **Safe moves between hosts.** One authority issues epochs. Every HEAD update is conditional on `{gen, epoch}`, so + the store refuses a stale holder even before it notices it was replaced + ([volume lifecycle](docs/volume-lifecycle.md), [TLA+ specifications](docs/spec/README.md)). +- **Self-hosted.** Go, Apache-2.0, on your own hosts and your own SeaweedFS. + +## Measured results + + + + Time on Seaweed Block relative to a local disk: npm ci 1.00, git clone 1.02, untar 100,000 files 1.04, cold find and stat 0.97, 2,000 create plus write plus fsync 1.39, guest fsync median 1.18. + + +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. 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)). The chart is drawn from +[measured-results.csv](docs/assets/measured-results.csv) by `scripts/readme-chart.py`. + +| 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` (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 of a 10 GiB volume (2,560 chunks) | 0.18 ms | | +| Two-host lifecycle (pre-release): create, snapshot, fork, move, stale holder, delete, GC | 35 of 35 checks | | + +The snapshot row is a host-side proxy without network latency, guest `fsync` or the block frontend. The two-host +lifecycle row is a pre-release run that included fork (removed from this release) and the earlier GC. The remaining +cost is `fsync`: a median of 3.23 ms against 2.74 ms local with ublk (3.59 ms over NVMe/TCP loopback). +[Workspace measurements](docs/workspace-measurements.md) has every number, the FUSE comparison and how each was +measured. + +## How it compares + +By design category; the other columns summarize what representative projects in each category state in their own +public documentation, and a given product may differ. + +| | Seaweed Block | Replicated block storage for Kubernetes | Block devices in a distributed storage cluster | Hosted sandbox disks on object storage | +|---|---|---|---|---| +| A write is acknowledged | on the local WAL of the host that serves the volume | after the replicas complete it | after the primary has its replicas' confirmation | from a local cache, uploaded in the background | +| Snapshots live | in your SeaweedFS, as shared 4 MiB chunks | with the replicas; backups go to an external store | in the cluster's pool | in the provider's object storage | +| Restore | a new volume that reads the snapshot's chunks on first use | a new volume from a snapshot or backup | a rollback in place, or a copy-on-write clone | in place, replacing the writable layer | +| Two writers are prevented by | an epoch authority and HEAD updates conditional on `{gen, epoch}` | one attachment per volume | an exclusive lock that a new holder breaks by blocklisting the old one | not stated | +| A lost host loses | the writes since the last cut (one replica) | nothing the other replicas hold | nothing the other replicas hold | not stated | +| Kubernetes | CSI driver (alpha), and standalone without it | runs on Kubernetes | optional CSI driver | not part of it | +| Self-hosted | yes | yes | yes | no | + +## Status and limits + +- **v1.0.0 supports** the single-replica volume (`--durable-impl walstore-chunk`), backed up to SeaweedFS with + snapshots, restore, moves and volume delete. New volumes are at most 256 GiB. See the + [release note](docs/releases/v1.0.0.md) and its [known limits](docs/releases/v1.0.0.md#known-limits). +- **Replicated volumes** are a preview ([replicated volumes preview](docs/releases/replicated-volumes-preview.md)). +- **Kubernetes** is an alpha, for supported lab clusters ([Kubernetes status](docs/kubernetes-status.md)). +- **Planned for v1.0.1:** larger volumes, a troubleshooting check and page, and an interactive `sw-block shell`. + ## Agent workspace disks: chunk lifecycle The workspace path runs `blockvolume` with `--durable-impl=walstore-chunk`, @@ -180,8 +175,7 @@ helm uninstall sw-block --namespace kube-system bash scripts/uninstall-k8s-alpha.sh "$PWD" && bash scripts/verify-helm-cleanup.sh ``` - -## Status +## Detailed status | Area | Status | |---|---| @@ -261,6 +255,11 @@ go test ./cmd/sw-block ./core/ops ./core/csi ./core/launcher ./core/host/master The full `go test ./...` sweep may include in-progress packages outside the release gate. `scripts/activate-k8s-alpha.sh` remains for local images. +## Community + +Questions and bug reports: [GitHub Issues](https://github.com/seaweedfs/seaweed-block/issues). Seaweed Block builds on +[SeaweedFS](https://github.com/seaweedfs/seaweedfs). + ## License Apache-2.0 diff --git a/seaweed-block/scripts/readme-chart.py b/seaweed-block/scripts/readme-chart.py index d60e166703..14713bbcd9 100644 --- a/seaweed-block/scripts/readme-chart.py +++ b/seaweed-block/scripts/readme-chart.py @@ -105,7 +105,7 @@ def main(): for theme, path in OUT.items(): text = svg(theme) if check: - if not path.exists() or path.read_text(encoding="utf-8") != text: + if not path.exists() or path.read_text(encoding="utf-8").replace("\r\n", "\n") != text: stale.append(str(path.relative_to(ROOT))) else: path.write_text(text, encoding="utf-8", newline="\n") From 1fa6bec4b206d6678080b1018b14569d31298599 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:23:17 -0800 Subject: [PATCH 3/7] docs(readme): keep the chart script with its data under docs/assets Co-Authored-By: Claude Opus 5.5 --- seaweed-block/README.md | 2 +- seaweed-block/{scripts => docs/assets}/readme-chart.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename seaweed-block/{scripts => docs/assets}/readme-chart.py (96%) diff --git a/seaweed-block/README.md b/seaweed-block/README.md index d229dae915..d82942fe80 100644 --- a/seaweed-block/README.md +++ b/seaweed-block/README.md @@ -73,7 +73,7 @@ Lab runs, median of 3; not SLOs. Workloads: Firecracker microVMs (4 vCPU, 4 GiB) NVMe/TCP loopback, against a local 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)). The chart is drawn from -[measured-results.csv](docs/assets/measured-results.csv) by `scripts/readme-chart.py`. +[measured-results.csv](docs/assets/measured-results.csv) by `docs/assets/readme-chart.py`. | Measurement | Seaweed Block | Local disk | |---|---|---| diff --git a/seaweed-block/scripts/readme-chart.py b/seaweed-block/docs/assets/readme-chart.py similarity index 96% rename from seaweed-block/scripts/readme-chart.py rename to seaweed-block/docs/assets/readme-chart.py index 14713bbcd9..98486fccd7 100644 --- a/seaweed-block/scripts/readme-chart.py +++ b/seaweed-block/docs/assets/readme-chart.py @@ -6,14 +6,14 @@ a local disk (local disk = 1.0), so rows with different units share one axis. Writes a light and a dark SVG next to the CSV. With --check, it writes nothing and exits 1 if either SVG differs from what the CSV gives. -usage: python3 scripts/readme-chart.py [--check] +usage: python3 docs/assets/readme-chart.py [--check] """ import csv import sys from pathlib import Path from xml.sax.saxutils import escape -ROOT = Path(__file__).resolve().parent.parent +ROOT = Path(__file__).resolve().parent.parent.parent CSV = ROOT / "docs" / "assets" / "measured-results.csv" OUT = {"light": ROOT / "docs" / "assets" / "measured-results-light.svg", "dark": ROOT / "docs" / "assets" / "measured-results-dark.svg"} @@ -110,7 +110,7 @@ def main(): else: path.write_text(text, encoding="utf-8", newline="\n") if stale: - print("stale, rerun scripts/readme-chart.py: " + ", ".join(stale)) + print("stale, rerun docs/assets/readme-chart.py: " + ", ".join(stale)) return 1 return 0 From b8eff10315c7f8babf8dd4c5e5a99610e5ca8e98 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:28:31 -0800 Subject: [PATCH 4/7] docs(readme): recovery point beside the claims; fsync scope; NVMe/TCP rows With the default settings a lost host loses up to about a day of writes: the pitch and the first line of status say so, with the flag that shortens it. The fsync point is scoped to the serving host. The FUSE factor is one implementation on the same host, in its own point. The chart and table lead with NVMe/TCP (ublk is not a v1.0.0 frontend); the diagram names NVMe/TCP or iSCSI and the daily default. The chart's axis fits every bar, and the script refuses a value beyond it. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/README.md | 42 +++++++++++-------- .../docs/assets/measured-results-dark.svg | 38 +++++++++-------- .../docs/assets/measured-results-light.svg | 38 +++++++++-------- .../docs/assets/measured-results.csv | 4 +- seaweed-block/docs/assets/readme-chart.py | 7 +++- .../docs/assets/seaweed-block-hero.svg | 6 +-- seaweed-block/docs/workspace-measurements.md | 5 ++- 7 files changed, 77 insertions(+), 63 deletions(-) diff --git a/seaweed-block/README.md b/seaweed-block/README.md index d82942fe80..c9c8e05a91 100644 --- a/seaweed-block/README.md +++ b/seaweed-block/README.md @@ -7,11 +7,12 @@ **Block storage for AI agent workspaces at local-disk speed, with snapshots, restore and moves backed by your own [SeaweedFS](https://github.com/seaweedfs/seaweedfs).** Each sandbox or microVM gets a plain virtio block disk. Writes -and `fsync` complete on the host's local disk; changed data goes to SeaweedFS in the background. The same core serves -Kubernetes block volumes (alpha). +and `fsync` complete on the host's local disk; cuts copy the changed data to SeaweedFS in the background. With the +default settings that is one snapshot a day, so losing the host loses up to about a day of writes; +`--chunk-capture-interval` (5 minutes or more) cuts more often. The same core serves Kubernetes block volumes (alpha).

- Seaweed Block. Write path: an agent sandbox or microVM writes over ublk or NVMe/TCP to blockvolume, which completes the write and fsync on its local WAL and acknowledges; nothing on this path waits on the network. Background path: a cut, on a schedule, at a snapshot or at detach, uploads only the changed 4 MiB chunks to your SeaweedFS, then updates the HEAD root with a conditional update on generation and epoch. blockmaster issues epochs and leases. Snapshots name a root and share chunks; a restore reads the snapshot's chunks on first use; a move hands the volume to another host at a higher epoch, and a stale holder's update is refused. + Seaweed Block. Write path: an agent sandbox or microVM writes over NVMe/TCP or iSCSI to blockvolume, which completes the write and fsync on its local WAL and acknowledges; nothing on this path waits on the network. Background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS, then updates the HEAD root with a conditional update on generation and epoch. blockmaster issues epochs and leases. Snapshots name a root and share chunks; a restore reads the snapshot's chunks on first use; a move hands the volume to another host at a higher epoch, and a stale holder's update is refused.

## Install @@ -47,13 +48,12 @@ above. To format and write, use the [write test](docs/standalone-deployment.md#w ## Why Seaweed Block -- **Local-disk speed for agent work.** `npm ci`, `git clone` and untar run within 0-4% of a local disk; against a - FUSE file system on the same host, untar, `npm ci` and `git clone` were 5 to 62 times faster +- **Local-disk speed for agent work.** `npm ci`, `git clone` and untar run within 0-4% of a local disk ([measured results](#measured-results), [how each was measured](docs/workspace-measurements.md)). -- **`fsync` means durable.** Every guest `fsync` reaches the backend sync; no write cache is turned off to get the - speed (a gate counts flushes against backend syncs, with an unsafe-cache control). In fault injection on the - release candidate, 0 acknowledged writes were lost across 253 judged - ([records](docs/workspace-measurements.md)). +- **`fsync` is durable on the host that serves the volume.** Every guest `fsync` reaches the host's disk; no write + cache is turned off to get the speed (a gate counts flushes against backend syncs, with an unsafe-cache control). + In fault injection on the release candidate, 0 acknowledged writes were lost across 253 judged. If the host itself + is lost, the volume comes back from its last cut ([records](docs/workspace-measurements.md)). - **Snapshots in your object store.** A cut uploads only the changed 4 MiB chunks. A snapshot names a root of about 2 KB and shares its chunks; a restore makes a new volume that reads them on first use ([agent workspace design](docs/design/agent-workspace-design.md)). @@ -61,32 +61,34 @@ above. To format and write, use the [write test](docs/standalone-deployment.md#w the store refuses a stale holder even before it notices it was replaced ([volume lifecycle](docs/volume-lifecycle.md), [TLA+ specifications](docs/spec/README.md)). - **Self-hosted.** Go, Apache-2.0, on your own hosts and your own SeaweedFS. +- **Against one FUSE implementation on the same host,** untar, `npm ci` and `git clone` were 5 to 62 times faster; + `fsync`-bound work took the same time ([record](docs/workspace-measurements.md)). ## Measured results - Time on Seaweed Block relative to a local disk: npm ci 1.00, git clone 1.02, untar 100,000 files 1.04, cold find and stat 0.97, 2,000 create plus write plus fsync 1.39, guest fsync median 1.18. + Time on Seaweed Block relative to a local disk, over NVMe/TCP loopback: npm ci 1.00, git clone 1.02, untar 100,000 files 1.04, cold find and stat 0.97, 2,000 create plus write plus fsync 1.52, guest fsync median 1.31. 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. 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)). The chart is drawn from +NVMe/TCP loopback, against a local file-backed disk. The two `fsync` rows come from a later run on the same host, +after the group-commit fix ([#173](https://github.com/seaweedfs/seaweed-block/pull/173)). The chart is drawn from [measured-results.csv](docs/assets/measured-results.csv) by `docs/assets/readme-chart.py`. | 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` (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 | +| 2,000 × create + write + `fsync` | 9.27 s | 6.11 s | +| Guest `fsync` median, fio 4 KiB random write, one at a time | 3.59 ms | 2.74 ms | | Snapshot of a 10 GiB volume (2,560 chunks) | 0.18 ms | | | Two-host lifecycle (pre-release): create, snapshot, fork, move, stale holder, delete, GC | 35 of 35 checks | | The snapshot row is a host-side proxy without network latency, guest `fsync` or the block frontend. The two-host lifecycle row is a pre-release run that included fork (removed from this release) and the earlier GC. The remaining -cost is `fsync`: a median of 3.23 ms against 2.74 ms local with ublk (3.59 ms over NVMe/TCP loopback). +cost is `fsync`: a median of 3.59 ms against 2.74 ms local over NVMe/TCP loopback. The ublk frontend measured +3.23 ms in the same run; ublk is not among v1.0.0's supported frontends (NVMe/TCP and iSCSI). [Workspace measurements](docs/workspace-measurements.md) has every number, the FUSE comparison and how each was measured. @@ -107,12 +109,16 @@ public documentation, and a given product may differ. ## Status and limits +- **Recovery point:** with the default settings, a lost host loses what was written since the volume's last + successful snapshot, normally up to about a day (one scheduled snapshot a day). `--chunk-capture-interval` + (5 minutes or more) adds periodic cuts and shortens it. - **v1.0.0 supports** the single-replica volume (`--durable-impl walstore-chunk`), backed up to SeaweedFS with snapshots, restore, moves and volume delete. New volumes are at most 256 GiB. See the [release note](docs/releases/v1.0.0.md) and its [known limits](docs/releases/v1.0.0.md#known-limits). - **Replicated volumes** are a preview ([replicated volumes preview](docs/releases/replicated-volumes-preview.md)). - **Kubernetes** is an alpha, for supported lab clusters ([Kubernetes status](docs/kubernetes-status.md)). - **Planned for v1.0.1:** larger volumes, a troubleshooting check and page, and an interactive `sw-block shell`. + The recovery point above does not change in v1.0.1. ## Agent workspace disks: chunk lifecycle @@ -199,8 +205,8 @@ Secrets first ([quickstart](docs/quickstart-kubernetes.md)). ### Not claimed yet - Production readiness, SLOs, or a published performance, RTO or RPO claim. -- `fsync` parity with local disk. Today it is about 1.2× local (see Measured - results). +- `fsync` parity with local disk. Today it is about 1.3× local over NVMe/TCP + (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/measured-results-dark.svg b/seaweed-block/docs/assets/measured-results-dark.svg index c978e32100..1d10d363c0 100644 --- a/seaweed-block/docs/assets/measured-results-dark.svg +++ b/seaweed-block/docs/assets/measured-results-dark.svg @@ -1,41 +1,43 @@ Workload time on Seaweed Block relative to a local disk -npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.39 times local (8.48 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.18 times local (3.23 ms against 2.74 ms) +npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.52 times local (9.27 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.31 times local (3.59 ms against 2.74 ms) Time on Seaweed Block relative to a local disk (local disk = 1.0) Lab runs, median of 3, not SLOs. Lower is faster. 0.0 - -0.5 - -1.0 + +0.5 + +1.0 + +1.5 -1.5 - -local disk +2.0 + +local disk npm ci (617 packages; offline) NVMe/TCP loopback -npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) +npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) 1.00x (2.14 s / 2.14 s) git clone (Go 1.23; local) NVMe/TCP loopback -git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) +git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) 1.02x (7.10 s / 6.99 s) Untar 100,000 files NVMe/TCP loopback -Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) +Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) 1.04x (1.10 s / 1.06 s) Cold find + stat over them NVMe/TCP loopback -Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) +Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) 0.97x (0.32 s / 0.33 s) 2000 x create + write + fsync -ublk -2000 x create + write + fsync: 1.39 x local (8.48 s against 6.11 s) -1.39x (8.48 s / 6.11 s) +NVMe/TCP loopback +2000 x create + write + fsync: 1.52 x local (9.27 s against 6.11 s) +1.52x (9.27 s / 6.11 s) Guest fsync median (fio 4 KiB) -ublk -Guest fsync median (fio 4 KiB): 1.18 x local (3.23 ms against 2.74 ms) -1.18x (3.23 ms / 2.74 ms) +NVMe/TCP loopback +Guest fsync median (fio 4 KiB): 1.31 x local (3.59 ms against 2.74 ms) +1.31x (3.59 ms / 2.74 ms) diff --git a/seaweed-block/docs/assets/measured-results-light.svg b/seaweed-block/docs/assets/measured-results-light.svg index 760204f6f8..052a78e16a 100644 --- a/seaweed-block/docs/assets/measured-results-light.svg +++ b/seaweed-block/docs/assets/measured-results-light.svg @@ -1,41 +1,43 @@ Workload time on Seaweed Block relative to a local disk -npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.39 times local (8.48 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.18 times local (3.23 ms against 2.74 ms) +npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.52 times local (9.27 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.31 times local (3.59 ms against 2.74 ms) Time on Seaweed Block relative to a local disk (local disk = 1.0) Lab runs, median of 3, not SLOs. Lower is faster. 0.0 - -0.5 - -1.0 + +0.5 + +1.0 + +1.5 -1.5 - -local disk +2.0 + +local disk npm ci (617 packages; offline) NVMe/TCP loopback -npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) +npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) 1.00x (2.14 s / 2.14 s) git clone (Go 1.23; local) NVMe/TCP loopback -git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) +git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) 1.02x (7.10 s / 6.99 s) Untar 100,000 files NVMe/TCP loopback -Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) +Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) 1.04x (1.10 s / 1.06 s) Cold find + stat over them NVMe/TCP loopback -Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) +Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) 0.97x (0.32 s / 0.33 s) 2000 x create + write + fsync -ublk -2000 x create + write + fsync: 1.39 x local (8.48 s against 6.11 s) -1.39x (8.48 s / 6.11 s) +NVMe/TCP loopback +2000 x create + write + fsync: 1.52 x local (9.27 s against 6.11 s) +1.52x (9.27 s / 6.11 s) Guest fsync median (fio 4 KiB) -ublk -Guest fsync median (fio 4 KiB): 1.18 x local (3.23 ms against 2.74 ms) -1.18x (3.23 ms / 2.74 ms) +NVMe/TCP loopback +Guest fsync median (fio 4 KiB): 1.31 x local (3.59 ms against 2.74 ms) +1.31x (3.59 ms / 2.74 ms) diff --git a/seaweed-block/docs/assets/measured-results.csv b/seaweed-block/docs/assets/measured-results.csv index 39103d5bc5..c49ac3f6b2 100644 --- a/seaweed-block/docs/assets/measured-results.csv +++ b/seaweed-block/docs/assets/measured-results.csv @@ -3,5 +3,5 @@ npm ci (617 packages; offline),2.14,2.14,s,NVMe/TCP loopback git clone (Go 1.23; local),7.10,6.99,s,NVMe/TCP loopback "Untar 100,000 files",1.10,1.06,s,NVMe/TCP loopback Cold find + stat over them,0.32,0.33,s,NVMe/TCP loopback -2000 x create + write + fsync,8.48,6.11,s,ublk -Guest fsync median (fio 4 KiB),3.23,2.74,ms,ublk +2000 x create + write + fsync,9.27,6.11,s,NVMe/TCP loopback +Guest fsync median (fio 4 KiB),3.59,2.74,ms,NVMe/TCP loopback diff --git a/seaweed-block/docs/assets/readme-chart.py b/seaweed-block/docs/assets/readme-chart.py index 98486fccd7..0c8b068891 100644 --- a/seaweed-block/docs/assets/readme-chart.py +++ b/seaweed-block/docs/assets/readme-chart.py @@ -27,8 +27,8 @@ THEMES = { W, LABEL_W, RIGHT_W = 760, 250, 150 ROW_H, BAR_H, TOP, BOTTOM = 34, 14, 56, 44 -XMAX = 1.5 -TICKS = [0.0, 0.5, 1.0, 1.5] +XMAX = 2.0 +TICKS = [0.0, 0.5, 1.0, 1.5, 2.0] def rows(): @@ -55,6 +55,9 @@ def bar_path(x0, y, w, h, r=4): def svg(theme): t = THEMES[theme] data = rows() + for w, sb, lo, _, _ in data: + if sb / lo > XMAX: + raise SystemExit(f"{w}: {sb / lo:.2f} is beyond the axis ({XMAX}); raise XMAX") plot_w = W - LABEL_W - RIGHT_W h = TOP + ROW_H * len(data) + BOTTOM diff --git a/seaweed-block/docs/assets/seaweed-block-hero.svg b/seaweed-block/docs/assets/seaweed-block-hero.svg index 8196437164..5cbd3d3b37 100644 --- a/seaweed-block/docs/assets/seaweed-block-hero.svg +++ b/seaweed-block/docs/assets/seaweed-block-hero.svg @@ -1,6 +1,6 @@ Seaweed Block: the write path and the background path - Left, the write path: an agent sandbox or microVM writes to a plain virtio block disk; ublk or NVMe/TCP carries the request to blockvolume, which completes the write and fsync on its local WAL and acknowledges. Nothing on this path waits on the network. Right, the background path: a cut, on a schedule, at a snapshot or at detach, uploads only the changed 4 MiB chunks to your SeaweedFS and then updates the volume's HEAD root with a conditional update on generation and epoch. A snapshot names a root and shares its chunks; a restore makes a new volume that reads chunks on first use; a move lets another host take over at a higher epoch, and a stale holder's update is refused. Above both, blockmaster issues epochs and leases. The same core serves Kubernetes volumes through the CSI driver (alpha). + Left, the write path: an agent sandbox or microVM writes to a plain virtio block disk; NVMe/TCP or iSCSI carries the request to blockvolume, which completes the write and fsync on its local WAL and acknowledges. Nothing on this path waits on the network. Right, the background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS and then updates the volume's HEAD root with a conditional update on generation and epoch. A snapshot names a root and shares its chunks; a restore makes a new volume that reads chunks on first use; a move lets another host take over at a higher epoch, and a stale holder's update is refused. Above both, blockmaster issues epochs and leases. The same core serves Kubernetes volumes through the CSI driver (alpha).

- Seaweed Block. Write path: an agent sandbox or microVM writes over NVMe/TCP or iSCSI to blockvolume, which completes the write and fsync on its local WAL and acknowledges; nothing on this path waits on the network. Background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS, then updates the HEAD root with a conditional update on generation and epoch. blockmaster issues epochs and leases. Snapshots name a root and share chunks; a restore reads the snapshot's chunks on first use; a move hands the volume to another host at a higher epoch, and a stale holder's update is refused. + Seaweed Block. Write path: an agent sandbox or microVM writes over NVMe/TCP or iSCSI to blockvolume, which completes the write and fsync on its local WAL and acknowledges; a write does not wait on SeaweedFS, except that a restored volume fetches each chunk from its snapshot once, on its first read or write. Background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS, then updates the HEAD root with a conditional update on generation and epoch. blockmaster issues epochs and leases. Snapshots name a root and share chunks; a restore reads the snapshot's chunks on first use; a move hands the volume to another host at a higher epoch, and a stale holder's update is refused.

## Install @@ -48,21 +48,27 @@ above. To format and write, use the [write test](docs/standalone-deployment.md#w ## Why Seaweed Block -- **Local-disk speed for agent work.** `npm ci`, `git clone` and untar run within 0-4% of a local disk - ([measured results](#measured-results), [how each was measured](docs/workspace-measurements.md)). +- **Close to local-disk speed for agent work.** In a pre-release run on the `walstore` engine (the local engine the + released chunk path builds on), `npm ci`, `git clone` and untar ran within 0-4% of a local disk for the operation + itself, and 11-23% slower with the final file-system flush included. On the released path, `fsync` costs about + 1.3 times local ([measured results](#measured-results), [how each was measured](docs/workspace-measurements.md)). - **`fsync` is durable on the host that serves the volume.** Every guest `fsync` reaches the host's disk; no write cache is turned off to get the speed (a gate counts flushes against backend syncs, with an unsafe-cache control). - In fault injection on the release candidate, 0 acknowledged writes were lost across 253 judged. If the host itself - is lost, the volume comes back from its last cut ([records](docs/workspace-measurements.md)). + In fault injection on the release candidate (process kills and a store pause on one host; not a power-loss test), + 0 acknowledged writes were lost across 253 judged; the same runs failed other operation checks, listed with the + record. If the host itself is lost, the volume comes back from its last cut + ([records](docs/workspace-measurements.md)). - **Snapshots in your object store.** A cut uploads only the changed 4 MiB chunks. A snapshot names a root of about 2 KB and shares its chunks; a restore makes a new volume that reads them on first use ([agent workspace design](docs/design/agent-workspace-design.md)). -- **Safe moves between hosts.** One authority issues epochs. Every HEAD update is conditional on `{gen, epoch}`, so - the store refuses a stale holder even before it notices it was replaced +- **Safe moves between hosts.** One blockmaster issues epochs and leases, and a holder admits I/O only while its own + lease is current; run exactly one blockmaster per cluster. Separately, every HEAD update is conditional on + `{gen, epoch}`, so the store refuses a stale holder's publish even before that holder notices it was replaced ([volume lifecycle](docs/volume-lifecycle.md), [TLA+ specifications](docs/spec/README.md)). - **Self-hosted.** Go, Apache-2.0, on your own hosts and your own SeaweedFS. -- **Against one FUSE implementation on the same host,** untar, `npm ci` and `git clone` were 5 to 62 times faster; - `fsync`-bound work took the same time ([record](docs/workspace-measurements.md)). +- **Against an early FUSE prototype on the same host** (host-side, built on the SeaweedFS filer; not a released + product), in the same pre-release run, untar, `npm ci` and `git clone` were 4 to 36 times faster with the final + flush included; `fsync`-bound work took the same time ([record](docs/workspace-measurements.md)). ## Measured results @@ -72,8 +78,11 @@ above. To format and write, use the [write test](docs/standalone-deployment.md#w 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. The two `fsync` rows come from a later run on the same host, -after the group-commit fix ([#173](https://github.com/seaweedfs/seaweed-block/pull/173)). The chart is drawn from +NVMe/TCP loopback, against a local file-backed disk. The first four rows come from a pre-release build on the +`walstore` engine and time the operation itself; a final `syncfs` flush, recorded separately, adds 11-23% to the +first three (see the measurements page). The two `fsync` rows come from a later run of the released path +(`walstore-chunk`) on the same host, after the group-commit fix +([#173](https://github.com/seaweedfs/seaweed-block/pull/173)). The chart is drawn from [measured-results.csv](docs/assets/measured-results.csv) by `docs/assets/readme-chart.py`. | Measurement | Seaweed Block | Local disk | @@ -92,25 +101,11 @@ cost is `fsync`: a median of 3.59 ms against 2.74 ms local over NVMe/TCP loopbac [Workspace measurements](docs/workspace-measurements.md) has every number, the FUSE comparison and how each was measured. -## How it compares - -By design category; the other columns summarize what representative projects in each category state in their own -public documentation, and a given product may differ. - -| | Seaweed Block | Replicated block storage for Kubernetes | Block devices in a distributed storage cluster | Hosted sandbox disks on object storage | -|---|---|---|---|---| -| A write is acknowledged | on the local WAL of the host that serves the volume | after the replicas complete it | after the primary has its replicas' confirmation | from a local cache, uploaded in the background | -| Snapshots live | in your SeaweedFS, as shared 4 MiB chunks | with the replicas; backups go to an external store | in the cluster's pool | in the provider's object storage | -| Restore | a new volume that reads the snapshot's chunks on first use | a new volume from a snapshot or backup | a rollback in place, or a copy-on-write clone | in place, replacing the writable layer | -| Two writers are prevented by | an epoch authority and HEAD updates conditional on `{gen, epoch}` | one attachment per volume | an exclusive lock that a new holder breaks by blocklisting the old one | not stated | -| A lost host loses | the writes since the last cut (one replica) | nothing the other replicas hold | nothing the other replicas hold | not stated | -| Kubernetes | CSI driver (alpha), and standalone without it | runs on Kubernetes | optional CSI driver | not part of it | -| Self-hosted | yes | yes | yes | no | - ## Status and limits -- **Recovery point:** with the default settings, a lost host loses what was written since the volume's last - successful snapshot, normally up to about a day (one scheduled snapshot a day). `--chunk-capture-interval` +- **Recovery point:** a lost host loses what was written since the volume's last successful snapshot or cut: + normally about a day with the default schedule (one scheduled snapshot a day, which is attempted, not + guaranteed). `--chunk-capture-interval` (5 minutes or more) adds periodic cuts and shortens it. - **v1.0.0 supports** the single-replica volume (`--durable-impl walstore-chunk`), backed up to SeaweedFS with snapshots, restore, moves and volume delete. New volumes are at most 256 GiB. See the diff --git a/seaweed-block/docs/assets/measured-results-dark.svg b/seaweed-block/docs/assets/measured-results-dark.svg index 1d10d363c0..9db164b963 100644 --- a/seaweed-block/docs/assets/measured-results-dark.svg +++ b/seaweed-block/docs/assets/measured-results-dark.svg @@ -3,7 +3,7 @@ npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.52 times local (9.27 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.31 times local (3.59 ms against 2.74 ms) Time on Seaweed Block relative to a local disk (local disk = 1.0) -Lab runs, median of 3, not SLOs. Lower is faster. +Lab runs over NVMe/TCP loopback, median of 3, not SLOs. Lower is faster. 0.0 @@ -17,27 +17,27 @@ local disk npm ci (617 packages; offline) -NVMe/TCP loopback +pre-release walstore; operation only npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) 1.00x (2.14 s / 2.14 s) git clone (Go 1.23; local) -NVMe/TCP loopback +pre-release walstore; operation only git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) 1.02x (7.10 s / 6.99 s) Untar 100,000 files -NVMe/TCP loopback +pre-release walstore; operation only Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) 1.04x (1.10 s / 1.06 s) Cold find + stat over them -NVMe/TCP loopback +pre-release walstore Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) 0.97x (0.32 s / 0.33 s) 2000 x create + write + fsync -NVMe/TCP loopback +walstore-chunk (released path) 2000 x create + write + fsync: 1.52 x local (9.27 s against 6.11 s) 1.52x (9.27 s / 6.11 s) Guest fsync median (fio 4 KiB) -NVMe/TCP loopback +walstore-chunk (released path) Guest fsync median (fio 4 KiB): 1.31 x local (3.59 ms against 2.74 ms) 1.31x (3.59 ms / 2.74 ms) diff --git a/seaweed-block/docs/assets/measured-results-light.svg b/seaweed-block/docs/assets/measured-results-light.svg index 052a78e16a..f428a56ecc 100644 --- a/seaweed-block/docs/assets/measured-results-light.svg +++ b/seaweed-block/docs/assets/measured-results-light.svg @@ -3,7 +3,7 @@ npm ci (617 packages; offline): 1.00 times local (2.14 s against 2.14 s); git clone (Go 1.23; local): 1.02 times local (7.10 s against 6.99 s); Untar 100,000 files: 1.04 times local (1.10 s against 1.06 s); Cold find + stat over them: 0.97 times local (0.32 s against 0.33 s); 2000 x create + write + fsync: 1.52 times local (9.27 s against 6.11 s); Guest fsync median (fio 4 KiB): 1.31 times local (3.59 ms against 2.74 ms) Time on Seaweed Block relative to a local disk (local disk = 1.0) -Lab runs, median of 3, not SLOs. Lower is faster. +Lab runs over NVMe/TCP loopback, median of 3, not SLOs. Lower is faster. 0.0 @@ -17,27 +17,27 @@ local disk npm ci (617 packages; offline) -NVMe/TCP loopback +pre-release walstore; operation only npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s) 1.00x (2.14 s / 2.14 s) git clone (Go 1.23; local) -NVMe/TCP loopback +pre-release walstore; operation only git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s) 1.02x (7.10 s / 6.99 s) Untar 100,000 files -NVMe/TCP loopback +pre-release walstore; operation only Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s) 1.04x (1.10 s / 1.06 s) Cold find + stat over them -NVMe/TCP loopback +pre-release walstore Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s) 0.97x (0.32 s / 0.33 s) 2000 x create + write + fsync -NVMe/TCP loopback +walstore-chunk (released path) 2000 x create + write + fsync: 1.52 x local (9.27 s against 6.11 s) 1.52x (9.27 s / 6.11 s) Guest fsync median (fio 4 KiB) -NVMe/TCP loopback +walstore-chunk (released path) Guest fsync median (fio 4 KiB): 1.31 x local (3.59 ms against 2.74 ms) 1.31x (3.59 ms / 2.74 ms) diff --git a/seaweed-block/docs/assets/measured-results.csv b/seaweed-block/docs/assets/measured-results.csv index c49ac3f6b2..6504a42668 100644 --- a/seaweed-block/docs/assets/measured-results.csv +++ b/seaweed-block/docs/assets/measured-results.csv @@ -1,7 +1,7 @@ workload,seaweed_block,local_disk,unit,frontend -npm ci (617 packages; offline),2.14,2.14,s,NVMe/TCP loopback -git clone (Go 1.23; local),7.10,6.99,s,NVMe/TCP loopback -"Untar 100,000 files",1.10,1.06,s,NVMe/TCP loopback -Cold find + stat over them,0.32,0.33,s,NVMe/TCP loopback -2000 x create + write + fsync,9.27,6.11,s,NVMe/TCP loopback -Guest fsync median (fio 4 KiB),3.59,2.74,ms,NVMe/TCP loopback +npm ci (617 packages; offline),2.14,2.14,s,pre-release walstore; operation only +git clone (Go 1.23; local),7.10,6.99,s,pre-release walstore; operation only +"Untar 100,000 files",1.10,1.06,s,pre-release walstore; operation only +Cold find + stat over them,0.32,0.33,s,pre-release walstore +2000 x create + write + fsync,9.27,6.11,s,walstore-chunk (released path) +Guest fsync median (fio 4 KiB),3.59,2.74,ms,walstore-chunk (released path) diff --git a/seaweed-block/docs/assets/readme-chart.py b/seaweed-block/docs/assets/readme-chart.py index 0c8b068891..a5c898a2e9 100644 --- a/seaweed-block/docs/assets/readme-chart.py +++ b/seaweed-block/docs/assets/readme-chart.py @@ -74,7 +74,7 @@ def svg(theme): f'' 'Time on Seaweed Block relative to a local disk (local disk = 1.0)', f'' - 'Lab runs, median of 3, not SLOs. Lower is faster.', + 'Lab runs over NVMe/TCP loopback, median of 3, not SLOs. Lower is faster.', ] for v in TICKS: parts.append(f' Seaweed Block: the write path and the background path - Left, the write path: an agent sandbox or microVM writes to a plain virtio block disk; NVMe/TCP or iSCSI carries the request to blockvolume, which completes the write and fsync on its local WAL and acknowledges. Nothing on this path waits on the network. Right, the background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS and then updates the volume's HEAD root with a conditional update on generation and epoch. A snapshot names a root and shares its chunks; a restore makes a new volume that reads chunks on first use; a move lets another host take over at a higher epoch, and a stale holder's update is refused. Above both, blockmaster issues epochs and leases. The same core serves Kubernetes volumes through the CSI driver (alpha). + Left, the write path: an agent sandbox or microVM writes to a plain virtio block disk; NVMe/TCP or iSCSI carries the request to blockvolume, which completes the write and fsync on its local WAL and acknowledges. A write does not wait on SeaweedFS, except that a restored volume fetches each chunk from its snapshot once, on its first read or write. Right, the background path: a cut (by default one scheduled snapshot a day; periodic cuts are optional) uploads only the changed 4 MiB chunks to your SeaweedFS and then updates the volume's HEAD root with a conditional update on generation and epoch. A snapshot names a root and shares its chunks; a restore makes a new volume that reads chunks on first use; a move lets another host take over at a higher epoch, and a stale holder's update is refused. Above both, blockmaster issues epochs and leases. The same core serves Kubernetes volumes through the CSI driver (alpha).