Merge pull request #716 from seaweedfs/docs/readme-rewrite

docs(readme): rewrite: pitch, two-path diagram, why, chart
This commit is contained in:
Ping Qiu authored and GitHub committed 2026-11-28 13:54:42 -08:00
commit 68f0838b5e
7 files changed
+457 -194

No files matched your search

+89 -88
View File
@@ -1,93 +1,20 @@
# 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; cuts copy the changed data to SeaweedFS in the background. Losing the
host loses what was written since the last successful cut: normally about a day with the default schedule (one
snapshot a day), not a guaranteed bound; `--chunk-capture-interval` (5 minutes or more) cuts more often. The same core serves Kubernetes block volumes (alpha).
<p align="center">
<img src="docs/assets/seaweed-block-hero.svg" alt="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" width="100%">
<img src="docs/assets/seaweed-block-hero.svg" alt="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." width="100%">
</p>
## 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 +46,76 @@ 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
- **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. With the final file-system flush included on both sides, they were 11-23% slower than the local disk, and
untar of 5,000 small files took about 2.2 times as long. 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 (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 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 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
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/measured-results-dark.svg">
<img src="docs/assets/measured-results-light.svg" alt="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." width="100%">
</picture>
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 first four rows come from a pre-release build on the
`walstore` engine and time the operation itself. With the final `syncfs` flush included on both sides (recorded
separately), the first three are 11-23% slower than the local disk (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 |
|---|---|---|
| `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` | 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.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.
## Status and limits
- **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
[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
The workspace path runs `blockvolume` with `--durable-impl=walstore-chunk`,
@@ -180,8 +177,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 |
|---|---|
@@ -205,8 +201,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.
@@ -261,6 +257,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
@@ -0,0 +1,43 @@
<svg xmlns="http://www.w3.org/2000/svg" width="760" height="304" viewBox="0 0 760 304" role="img" aria-labelledby="t d" font-family="-apple-system,Segoe UI,Helvetica,Arial,sans-serif">
<title id="t">Workload time on Seaweed Block relative to a local disk</title>
<desc id="d">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)</desc>
<rect width="760" height="304" fill="#1a1a19"/>
<text x="16" y="24" font-size="15" font-weight="600" fill="#f0efec">Time on Seaweed Block relative to a local disk (local disk = 1.0)</text>
<text x="16" y="42" font-size="12" fill="#c3c2b7">Lab runs over NVMe/TCP loopback, median of 3, not SLOs. Lower is faster.</text>
<line x1="250.0" y1="50" x2="250.0" y2="260" stroke="#383835" stroke-width="1"/>
<text x="250.0" y="278" font-size="11" text-anchor="middle" fill="#c3c2b7">0.0</text>
<line x1="340.0" y1="50" x2="340.0" y2="260" stroke="#383835" stroke-width="1"/>
<text x="340.0" y="278" font-size="11" text-anchor="middle" fill="#c3c2b7">0.5</text>
<line x1="430.0" y1="50" x2="430.0" y2="260" stroke="#383835" stroke-width="1"/>
<text x="430.0" y="278" font-size="11" text-anchor="middle" fill="#c3c2b7">1.0</text>
<line x1="520.0" y1="50" x2="520.0" y2="260" stroke="#383835" stroke-width="1"/>
<text x="520.0" y="278" font-size="11" text-anchor="middle" fill="#c3c2b7">1.5</text>
<line x1="610.0" y1="50" x2="610.0" y2="260" stroke="#383835" stroke-width="1"/>
<text x="610.0" y="278" font-size="11" text-anchor="middle" fill="#c3c2b7">2.0</text>
<line x1="430.0" y1="50" x2="430.0" y2="260" stroke="#c3c2b7" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="430.0" y="294" font-size="11" text-anchor="middle" fill="#c3c2b7">local disk</text>
<text x="240" y="71.0" font-size="12" text-anchor="end" fill="#f0efec">npm ci (617 packages; offline)</text>
<text x="240" y="84.0" font-size="10" text-anchor="end" fill="#c3c2b7">pre-release walstore; operation only</text>
<path d="M250.0,66.0 H426.0 Q430.0,66.0 430.0,70.0 V76.0 Q430.0,80.0 426.0,80.0 H250.0 Z" fill="#3987e5"><title>npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s)</title></path>
<text x="620.0" y="77.0" font-size="12" fill="#f0efec">1.00x <tspan fill="#c3c2b7" font-size="11">(2.14 s / 2.14 s)</tspan></text>
<text x="240" y="105.0" font-size="12" text-anchor="end" fill="#f0efec">git clone (Go 1.23; local)</text>
<text x="240" y="118.0" font-size="10" text-anchor="end" fill="#c3c2b7">pre-release walstore; operation only</text>
<path d="M250.0,100.0 H428.8 Q432.8,100.0 432.8,104.0 V110.0 Q432.8,114.0 428.8,114.0 H250.0 Z" fill="#3987e5"><title>git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s)</title></path>
<text x="620.0" y="111.0" font-size="12" fill="#f0efec">1.02x <tspan fill="#c3c2b7" font-size="11">(7.10 s / 6.99 s)</tspan></text>
<text x="240" y="139.0" font-size="12" text-anchor="end" fill="#f0efec">Untar 100,000 files</text>
<text x="240" y="152.0" font-size="10" text-anchor="end" fill="#c3c2b7">pre-release walstore; operation only</text>
<path d="M250.0,134.0 H432.8 Q436.8,134.0 436.8,138.0 V144.0 Q436.8,148.0 432.8,148.0 H250.0 Z" fill="#3987e5"><title>Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s)</title></path>
<text x="620.0" y="145.0" font-size="12" fill="#f0efec">1.04x <tspan fill="#c3c2b7" font-size="11">(1.10 s / 1.06 s)</tspan></text>
<text x="240" y="173.0" font-size="12" text-anchor="end" fill="#f0efec">Cold find + stat over them</text>
<text x="240" y="186.0" font-size="10" text-anchor="end" fill="#c3c2b7">pre-release walstore</text>
<path d="M250.0,168.0 H420.5 Q424.5,168.0 424.5,172.0 V178.0 Q424.5,182.0 420.5,182.0 H250.0 Z" fill="#3987e5"><title>Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s)</title></path>
<text x="620.0" y="179.0" font-size="12" fill="#f0efec">0.97x <tspan fill="#c3c2b7" font-size="11">(0.32 s / 0.33 s)</tspan></text>
<text x="240" y="207.0" font-size="12" text-anchor="end" fill="#f0efec">2000 x create + write + fsync</text>
<text x="240" y="220.0" font-size="10" text-anchor="end" fill="#c3c2b7">walstore-chunk (released path)</text>
<path d="M250.0,202.0 H519.1 Q523.1,202.0 523.1,206.0 V212.0 Q523.1,216.0 519.1,216.0 H250.0 Z" fill="#3987e5"><title>2000 x create + write + fsync: 1.52 x local (9.27 s against 6.11 s)</title></path>
<text x="620.0" y="213.0" font-size="12" fill="#f0efec">1.52x <tspan fill="#c3c2b7" font-size="11">(9.27 s / 6.11 s)</tspan></text>
<text x="240" y="241.0" font-size="12" text-anchor="end" fill="#f0efec">Guest fsync median (fio 4 KiB)</text>
<text x="240" y="254.0" font-size="10" text-anchor="end" fill="#c3c2b7">walstore-chunk (released path)</text>
<path d="M250.0,236.0 H481.8 Q485.8,236.0 485.8,240.0 V246.0 Q485.8,250.0 481.8,250.0 H250.0 Z" fill="#3987e5"><title>Guest fsync median (fio 4 KiB): 1.31 x local (3.59 ms against 2.74 ms)</title></path>
<text x="620.0" y="247.0" font-size="12" fill="#f0efec">1.31x <tspan fill="#c3c2b7" font-size="11">(3.59 ms / 2.74 ms)</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

@@ -0,0 +1,43 @@
<svg xmlns="http://www.w3.org/2000/svg" width="760" height="304" viewBox="0 0 760 304" role="img" aria-labelledby="t d" font-family="-apple-system,Segoe UI,Helvetica,Arial,sans-serif">
<title id="t">Workload time on Seaweed Block relative to a local disk</title>
<desc id="d">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)</desc>
<rect width="760" height="304" fill="#fcfcfb"/>
<text x="16" y="24" font-size="15" font-weight="600" fill="#0b0b0b">Time on Seaweed Block relative to a local disk (local disk = 1.0)</text>
<text x="16" y="42" font-size="12" fill="#52514e">Lab runs over NVMe/TCP loopback, median of 3, not SLOs. Lower is faster.</text>
<line x1="250.0" y1="50" x2="250.0" y2="260" stroke="#e4e3df" stroke-width="1"/>
<text x="250.0" y="278" font-size="11" text-anchor="middle" fill="#52514e">0.0</text>
<line x1="340.0" y1="50" x2="340.0" y2="260" stroke="#e4e3df" stroke-width="1"/>
<text x="340.0" y="278" font-size="11" text-anchor="middle" fill="#52514e">0.5</text>
<line x1="430.0" y1="50" x2="430.0" y2="260" stroke="#e4e3df" stroke-width="1"/>
<text x="430.0" y="278" font-size="11" text-anchor="middle" fill="#52514e">1.0</text>
<line x1="520.0" y1="50" x2="520.0" y2="260" stroke="#e4e3df" stroke-width="1"/>
<text x="520.0" y="278" font-size="11" text-anchor="middle" fill="#52514e">1.5</text>
<line x1="610.0" y1="50" x2="610.0" y2="260" stroke="#e4e3df" stroke-width="1"/>
<text x="610.0" y="278" font-size="11" text-anchor="middle" fill="#52514e">2.0</text>
<line x1="430.0" y1="50" x2="430.0" y2="260" stroke="#52514e" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="430.0" y="294" font-size="11" text-anchor="middle" fill="#52514e">local disk</text>
<text x="240" y="71.0" font-size="12" text-anchor="end" fill="#0b0b0b">npm ci (617 packages; offline)</text>
<text x="240" y="84.0" font-size="10" text-anchor="end" fill="#52514e">pre-release walstore; operation only</text>
<path d="M250.0,66.0 H426.0 Q430.0,66.0 430.0,70.0 V76.0 Q430.0,80.0 426.0,80.0 H250.0 Z" fill="#2a78d6"><title>npm ci (617 packages; offline): 1.00 x local (2.14 s against 2.14 s)</title></path>
<text x="620.0" y="77.0" font-size="12" fill="#0b0b0b">1.00x <tspan fill="#52514e" font-size="11">(2.14 s / 2.14 s)</tspan></text>
<text x="240" y="105.0" font-size="12" text-anchor="end" fill="#0b0b0b">git clone (Go 1.23; local)</text>
<text x="240" y="118.0" font-size="10" text-anchor="end" fill="#52514e">pre-release walstore; operation only</text>
<path d="M250.0,100.0 H428.8 Q432.8,100.0 432.8,104.0 V110.0 Q432.8,114.0 428.8,114.0 H250.0 Z" fill="#2a78d6"><title>git clone (Go 1.23; local): 1.02 x local (7.10 s against 6.99 s)</title></path>
<text x="620.0" y="111.0" font-size="12" fill="#0b0b0b">1.02x <tspan fill="#52514e" font-size="11">(7.10 s / 6.99 s)</tspan></text>
<text x="240" y="139.0" font-size="12" text-anchor="end" fill="#0b0b0b">Untar 100,000 files</text>
<text x="240" y="152.0" font-size="10" text-anchor="end" fill="#52514e">pre-release walstore; operation only</text>
<path d="M250.0,134.0 H432.8 Q436.8,134.0 436.8,138.0 V144.0 Q436.8,148.0 432.8,148.0 H250.0 Z" fill="#2a78d6"><title>Untar 100,000 files: 1.04 x local (1.10 s against 1.06 s)</title></path>
<text x="620.0" y="145.0" font-size="12" fill="#0b0b0b">1.04x <tspan fill="#52514e" font-size="11">(1.10 s / 1.06 s)</tspan></text>
<text x="240" y="173.0" font-size="12" text-anchor="end" fill="#0b0b0b">Cold find + stat over them</text>
<text x="240" y="186.0" font-size="10" text-anchor="end" fill="#52514e">pre-release walstore</text>
<path d="M250.0,168.0 H420.5 Q424.5,168.0 424.5,172.0 V178.0 Q424.5,182.0 420.5,182.0 H250.0 Z" fill="#2a78d6"><title>Cold find + stat over them: 0.97 x local (0.32 s against 0.33 s)</title></path>
<text x="620.0" y="179.0" font-size="12" fill="#0b0b0b">0.97x <tspan fill="#52514e" font-size="11">(0.32 s / 0.33 s)</tspan></text>
<text x="240" y="207.0" font-size="12" text-anchor="end" fill="#0b0b0b">2000 x create + write + fsync</text>
<text x="240" y="220.0" font-size="10" text-anchor="end" fill="#52514e">walstore-chunk (released path)</text>
<path d="M250.0,202.0 H519.1 Q523.1,202.0 523.1,206.0 V212.0 Q523.1,216.0 519.1,216.0 H250.0 Z" fill="#2a78d6"><title>2000 x create + write + fsync: 1.52 x local (9.27 s against 6.11 s)</title></path>
<text x="620.0" y="213.0" font-size="12" fill="#0b0b0b">1.52x <tspan fill="#52514e" font-size="11">(9.27 s / 6.11 s)</tspan></text>
<text x="240" y="241.0" font-size="12" text-anchor="end" fill="#0b0b0b">Guest fsync median (fio 4 KiB)</text>
<text x="240" y="254.0" font-size="10" text-anchor="end" fill="#52514e">walstore-chunk (released path)</text>
<path d="M250.0,236.0 H481.8 Q485.8,236.0 485.8,240.0 V246.0 Q485.8,250.0 481.8,250.0 H250.0 Z" fill="#2a78d6"><title>Guest fsync median (fio 4 KiB): 1.31 x local (3.59 ms against 2.74 ms)</title></path>
<text x="620.0" y="247.0" font-size="12" fill="#0b0b0b">1.31x <tspan fill="#52514e" font-size="11">(3.59 ms / 2.74 ms)</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

@@ -0,0 +1,7 @@
workload,seaweed_block,local_disk,unit,frontend
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)
1 workload seaweed_block local_disk unit frontend
2 npm ci (617 packages; offline) 2.14 2.14 s pre-release walstore; operation only
3 git clone (Go 1.23; local) 7.10 6.99 s pre-release walstore; operation only
4 Untar 100,000 files 1.10 1.06 s pre-release walstore; operation only
5 Cold find + stat over them 0.32 0.33 s pre-release walstore
6 2000 x create + write + fsync 9.27 6.11 s walstore-chunk (released path)
7 Guest fsync median (fio 4 KiB) 3.59 2.74 ms walstore-chunk (released path)
+122
View File
@@ -0,0 +1,122 @@
#!/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 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.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 = 2.0
TICKS = [0.0, 0.5, 1.0, 1.5, 2.0]
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()
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
def x(v):
return LABEL_W + plot_w * v / XMAX
parts = [
f'<svg xmlns="http://www.w3.org/2000/svg" width="{W}" height="{h}" viewBox="0 0 {W} {h}" '
f'role="img" aria-labelledby="t d" font-family="-apple-system,Segoe UI,Helvetica,Arial,sans-serif">',
'<title id="t">Workload time on Seaweed Block relative to a local disk</title>',
'<desc id="d">' + escape("; ".join(
f"{w}: {sb / lo:.2f} times local ({fmt(sb, u)} against {fmt(lo, u)})" for w, sb, lo, u, _ in data)) + '</desc>',
f'<rect width="{W}" height="{h}" fill="{t["surface"]}"/>',
f'<text x="16" y="24" font-size="15" font-weight="600" fill="{t["ink"]}">'
'Time on Seaweed Block relative to a local disk (local disk = 1.0)</text>',
f'<text x="16" y="42" font-size="12" fill="{t["ink2"]}">'
'Lab runs over NVMe/TCP loopback, median of 3, not SLOs. Lower is faster.</text>',
]
for v in TICKS:
parts.append(f'<line x1="{x(v):.1f}" y1="{TOP - 6}" x2="{x(v):.1f}" y2="{TOP + ROW_H * len(data)}" '
f'stroke="{t["grid"]}" stroke-width="1"/>')
parts.append(f'<text x="{x(v):.1f}" y="{TOP + ROW_H * len(data) + 18}" font-size="11" '
f'text-anchor="middle" fill="{t["ink2"]}">{v:.1f}</text>')
parts.append(f'<line x1="{x(1.0):.1f}" y1="{TOP - 6}" x2="{x(1.0):.1f}" y2="{TOP + ROW_H * len(data)}" '
f'stroke="{t["ref"]}" stroke-width="1.5" stroke-dasharray="4 3"/>')
parts.append(f'<text x="{x(1.0):.1f}" y="{TOP + ROW_H * len(data) + 34}" font-size="11" '
f'text-anchor="middle" fill="{t["ink2"]}">local disk</text>')
for i, (w, sb, lo, u, fe) in enumerate(data):
yc = TOP + ROW_H * i + ROW_H / 2
ratio = sb / lo
parts.append(f'<text x="{LABEL_W - 10}" y="{yc - 2:.1f}" font-size="12" text-anchor="end" '
f'fill="{t["ink"]}">{escape(w)}</text>')
parts.append(f'<text x="{LABEL_W - 10}" y="{yc + 11:.1f}" font-size="10" text-anchor="end" '
f'fill="{t["ink2"]}">{escape(fe)}</text>')
parts.append(f'<path d="{bar_path(x(0), yc - BAR_H / 2, x(min(ratio, XMAX)) - x(0), BAR_H)}" '
f'fill="{t["bar"]}"><title>{escape(w)}: {ratio:.2f} x local '
f'({fmt(sb, u)} against {fmt(lo, u)})</title></path>')
parts.append(f'<text x="{x(XMAX) + 10:.1f}" y="{yc + 4:.1f}" font-size="12" fill="{t["ink"]}">'
f'{ratio:.2f}x <tspan fill="{t["ink2"]}" font-size="11">'
f'({fmt(sb, u)} / {fmt(lo, u)})</tspan></text>')
parts.append("</svg>")
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").replace("\r\n", "\n") != text:
stale.append(str(path.relative_to(ROOT)))
else:
path.write_text(text, encoding="utf-8", newline="\n")
if stale:
print("stale, rerun docs/assets/readme-chart.py: " + ", ".join(stale))
return 1
return 0
if __name__ == "__main__":
sys.exit(main())
+102 -94
View File
@@ -1,105 +1,113 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="500" viewBox="0 0 1200 500" font-family="Inter, Segoe UI, Helvetica, Arial, sans-serif" role="img" aria-labelledby="title desc">
<title id="title">Seaweed Block: one block service core, two uses</title>
<desc id="desc">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.</desc>
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="580" viewBox="0 0 1200 580" font-family="-apple-system, Segoe UI, Helvetica, Arial, sans-serif" role="img" aria-labelledby="title desc">
<title id="title">Seaweed Block: the write path and the background path</title>
<desc id="desc">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).</desc>
<style>
.bg { fill: #fcfcfb; }
.box { fill: #ffffff; stroke: #d6d5d0; stroke-width: 1.2; }
.panel { fill: #f3f2ef; }
.ink { fill: #0b0b0b; }
.ink2 { fill: #52514e; }
.sync { stroke: #2a78d6; }
.bgp { stroke: #eb6834; }
.ctl { stroke: #8a8984; }
.syncfill { fill: #2a78d6; }
.bgfill { fill: #eb6834; }
.ctlfill { fill: #8a8984; }
@media (prefers-color-scheme: dark) {
.bg { fill: #1a1a19; }
.box { fill: #262624; stroke: #45443f; }
.panel { fill: #211f1e; }
.ink { fill: #f0efec; }
.ink2 { fill: #c3c2b7; }
.sync { stroke: #3987e5; }
.bgp { stroke: #d95926; }
.ctl { stroke: #8f8e88; }
.syncfill { fill: #3987e5; }
.bgfill { fill: #d95926; }
.ctlfill { fill: #8f8e88; }
}
</style>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#475569"/>
</marker>
<marker id="arrowG" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#0f766e"/>
</marker>
<marker id="arrowA" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse">
<path d="M0,0 L10,5 L0,10 z" fill="#b45309"/>
</marker>
<marker id="aS" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="syncfill" d="M0,0 L10,5 L0,10 z"/></marker>
<marker id="aB" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="bgfill" d="M0,0 L10,5 L0,10 z"/></marker>
<marker id="aC" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ctlfill" d="M0,0 L10,5 L0,10 z"/></marker>
</defs>
<rect width="1200" height="500" rx="18" fill="#f8fafc"/>
<rect class="bg" width="1200" height="580" rx="16"/>
<text class="ink" x="40" y="48" font-size="26" font-weight="700">Seaweed Block</text>
<text class="ink2" x="40" y="74" font-size="15">Writes complete on the host's local disk; snapshots, restore and moves go through your SeaweedFS in the background.</text>
<text x="40" y="52" font-size="26" font-weight="700" fill="#0f172a">Seaweed Block</text>
<text x="40" y="80" font-size="15" fill="#475569">One block service core · two uses: agent workspace disks and Kubernetes block volumes</text>
<!-- blockmaster -->
<rect class="box" x="430" y="96" width="340" height="58" rx="10"/>
<text class="ink" x="600" y="120" font-size="15" font-weight="600" text-anchor="middle">blockmaster: the epoch authority</text>
<text class="ink2" x="600" y="141" font-size="12.5" text-anchor="middle">assigns each volume's holder · issues epochs and leases</text>
<!-- Use 1: agent workspace disks -->
<text x="40" y="124" font-size="11.5" font-weight="700" fill="#4338ca" letter-spacing="0.06em">AGENT WORKSPACE DISKS</text>
<text x="212" y="124" font-size="11.5" fill="#64748b">· proof of concept</text>
<rect x="40" y="134" width="260" height="110" rx="12" fill="#eef2ff" stroke="#6366f1" stroke-width="1.5"/>
<text x="170" y="168" font-size="14" font-weight="600" fill="#312e81" text-anchor="middle">agent microVM</text>
<text x="170" y="190" font-size="12" fill="#4338ca" text-anchor="middle">/dev/vda · ext4</text>
<text x="170" y="212" font-size="11.5" fill="#4338ca" text-anchor="middle">one local-speed disk per sandbox</text>
<!-- panels -->
<rect class="panel" x="30" y="176" width="560" height="340" rx="12"/>
<rect class="panel" x="610" y="176" width="560" height="340" rx="12"/>
<line class="sync" x1="50" y1="200" x2="74" y2="200" stroke-width="4" stroke-linecap="round"/>
<text class="ink" x="84" y="205" font-size="14" font-weight="700">WRITE PATH (synchronous)</text>
<line class="bgp" x1="630" y1="200" x2="654" y2="200" stroke-width="4" stroke-linecap="round" stroke-dasharray="7 5"/>
<text class="ink" x="664" y="205" font-size="14" font-weight="700">BACKGROUND PATH (cuts)</text>
<!-- Use 2: Kubernetes block volumes -->
<text x="40" y="312" font-size="11.5" font-weight="700" fill="#b45309" letter-spacing="0.06em">KUBERNETES BLOCK VOLUMES</text>
<text x="238" y="312" font-size="11.5" fill="#64748b">· alpha</text>
<rect x="40" y="322" width="260" height="108" rx="12" fill="#fffbeb" stroke="#f59e0b" stroke-width="1.5"/>
<text x="170" y="356" font-size="14" font-weight="600" fill="#78350f" text-anchor="middle">app pod + PVC</text>
<text x="170" y="378" font-size="12" fill="#92400e" text-anchor="middle">blockcsi: provision, attach, mount</text>
<text x="170" y="400" font-size="11.5" fill="#92400e" text-anchor="middle">Helm chart · read-only status</text>
<!-- write path chain -->
<rect class="box" x="60" y="222" width="270" height="52" rx="9"/>
<text class="ink" x="195" y="244" font-size="14" font-weight="600" text-anchor="middle">agent sandbox or microVM</text>
<text class="ink2" x="195" y="263" font-size="12" text-anchor="middle">a plain virtio block disk</text>
<line class="sync" x1="195" y1="274" x2="195" y2="296" stroke-width="2" marker-end="url(#aS)"/>
<rect class="box" x="60" y="298" width="270" height="40" rx="9"/>
<text class="ink" x="195" y="323" font-size="13.5" text-anchor="middle">NVMe/TCP or iSCSI</text>
<line class="sync" x1="195" y1="338" x2="195" y2="360" stroke-width="2" marker-end="url(#aS)"/>
<rect class="box" x="60" y="362" width="270" height="40" rx="9"/>
<text class="ink" x="195" y="387" font-size="13.5" font-weight="600" text-anchor="middle">blockvolume (one per volume)</text>
<line class="sync" x1="195" y1="402" x2="195" y2="424" stroke-width="2" marker-end="url(#aS)"/>
<rect class="box" x="60" y="426" width="270" height="52" rx="9"/>
<text class="ink" x="195" y="448" font-size="13.5" font-weight="600" text-anchor="middle">local WAL + extent</text>
<text class="ink2" x="195" y="467" font-size="12" text-anchor="middle">walstore, on the host's disk</text>
<!-- ack, on the left of the chain -->
<path class="sync" d="M60,452 H44 V248 H56" fill="none" stroke-width="2" marker-end="url(#aS)"/>
<text class="ink2" x="378" y="244" font-size="12.5">a write does not wait on</text>
<text class="ink2" x="378" y="262" font-size="12.5">SeaweedFS (a restored volume</text>
<text class="ink2" x="378" y="280" font-size="12.5">fetches each chunk once,</text>
<text class="ink2" x="378" y="298" font-size="12.5">on first read or write)</text>
<text class="ink" x="378" y="446" font-size="13" font-weight="600">ack (left arrow)</text>
<text class="ink2" x="378" y="464" font-size="12.5">write and fsync complete</text>
<text class="ink2" x="378" y="482" font-size="12.5">on the local WAL</text>
<!-- Shared core -->
<rect x="380" y="110" width="440" height="320" rx="14" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5"/>
<text x="400" y="136" font-size="15" font-weight="700" fill="#0f172a">Shared core</text>
<!-- background chain -->
<rect class="box" x="640" y="222" width="290" height="52" rx="9"/>
<text class="ink" x="785" y="244" font-size="14" font-weight="600" text-anchor="middle">cut</text>
<text class="ink2" x="785" y="263" font-size="12" text-anchor="middle">daily snapshot by default; optional periodic cuts</text>
<line class="bgp" x1="785" y1="274" x2="785" y2="296" stroke-width="2" stroke-dasharray="6 4" marker-end="url(#aB)"/>
<rect class="box" x="640" y="298" width="290" height="40" rx="9"/>
<text class="ink" x="785" y="323" font-size="13.5" text-anchor="middle">only the changed 4 MiB chunks</text>
<line class="bgp" x1="785" y1="338" x2="785" y2="360" stroke-width="2" stroke-dasharray="6 4" marker-end="url(#aB)"/>
<rect class="box" x="640" y="362" width="290" height="40" rx="9"/>
<text class="ink" x="785" y="387" font-size="13.5" font-weight="600" text-anchor="middle">your SeaweedFS</text>
<line class="bgp" x1="785" y1="402" x2="785" y2="424" stroke-width="2" stroke-dasharray="6 4" marker-end="url(#aB)"/>
<rect class="box" x="640" y="426" width="290" height="52" rx="9"/>
<text class="ink" x="785" y="448" font-size="13.5" font-weight="600" text-anchor="middle">HEAD root (about 2 KB)</text>
<text class="ink2" x="785" y="467" font-size="12" text-anchor="middle">conditional update on {gen, epoch}</text>
<!-- background side notes -->
<text class="ink" x="948" y="244" font-size="13" font-weight="600">snapshot</text>
<text class="ink2" x="948" y="262" font-size="12">names a root; chunks are shared</text>
<text class="ink" x="948" y="300" font-size="13" font-weight="600">restore</text>
<text class="ink2" x="948" y="318" font-size="12">a new volume that reads the</text>
<text class="ink2" x="948" y="334" font-size="12">snapshot's chunks on first use</text>
<text class="ink" x="948" y="372" font-size="13" font-weight="600">move</text>
<text class="ink2" x="948" y="390" font-size="12">another host takes over at a</text>
<text class="ink2" x="948" y="406" font-size="12">higher epoch; a stale holder's</text>
<text class="ink2" x="948" y="422" font-size="12">HEAD update is refused</text>
<rect x="400" y="150" width="400" height="184" rx="10" fill="#f1f5f9" stroke="#94a3b8" stroke-width="1.5"/>
<text x="420" y="176" font-size="14" font-weight="700" fill="#0f172a">blockvolume</text>
<text x="780" y="176" font-size="11.5" fill="#64748b" text-anchor="end">one process per volume replica</text>
<!-- blockvolume to cut -->
<path class="bgp" d="M330,392 H600 V248 H636" fill="none" stroke-width="2" stroke-dasharray="6 4" marker-end="url(#aB)"/>
<rect x="420" y="190" width="110" height="28" rx="6" fill="#e2e8f0" stroke="#94a3b8"/>
<text x="475" y="209" font-size="12.5" font-weight="600" fill="#334155" text-anchor="middle">ublk</text>
<rect x="545" y="190" width="110" height="28" rx="6" fill="#e2e8f0" stroke="#94a3b8"/>
<text x="600" y="209" font-size="12.5" font-weight="600" fill="#334155" text-anchor="middle">NVMe/TCP</text>
<rect x="670" y="190" width="110" height="28" rx="6" fill="#e2e8f0" stroke="#94a3b8"/>
<text x="725" y="209" font-size="12.5" font-weight="600" fill="#334155" text-anchor="middle">iSCSI</text>
<!-- control lines from blockmaster -->
<path class="ctl" d="M430,125 H352 V372 H334" fill="none" stroke-width="1.5" stroke-dasharray="2 4" marker-end="url(#aC)"/>
<text class="ink2" x="360" y="340" font-size="11.5">epoch, lease</text>
<path class="ctl" d="M720,154 V170 H1110 V478 H934" fill="none" stroke-width="1.5" stroke-dasharray="2 4" marker-end="url(#aC)"/>
<text class="ink2" x="1030" y="190" font-size="11.5">epoch fencing</text>
<text x="600" y="242" font-size="12.5" fill="#334155" text-anchor="middle">one Backend contract: Read · Write · Sync</text>
<rect x="420" y="254" width="360" height="64" rx="8" fill="#ffffff" stroke="#94a3b8"/>
<text x="600" y="280" font-size="13" font-weight="600" fill="#0f172a" text-anchor="middle">local WAL engine: walstore</text>
<text x="600" y="300" font-size="11.5" fill="#475569" text-anchor="middle">WAL + extent · group fsync · typed recovery reasons</text>
<line x1="600" y1="350" x2="600" y2="337" stroke="#475569" stroke-width="1.6" marker-end="url(#arrow)"/>
<rect x="400" y="350" width="400" height="66" rx="10" fill="#f1f5f9" stroke="#94a3b8" stroke-width="1.5" stroke-dasharray="5 4"/>
<text x="600" y="377" font-size="13.5" font-weight="700" fill="#0f172a" text-anchor="middle">blockmaster · epoch authority</text>
<text x="600" y="399" font-size="11.5" fill="#475569" text-anchor="middle">assignments · epochs · leases · epoch fencing</text>
<!-- Into the core -->
<line x1="302" y1="190" x2="396" y2="204" stroke="#475569" stroke-width="1.6" marker-end="url(#arrow)"/>
<text x="349" y="182" font-size="11" fill="#64748b" text-anchor="middle">virtio-blk</text>
<line x1="302" y1="376" x2="396" y2="232" stroke="#475569" stroke-width="1.6" marker-end="url(#arrow)"/>
<text x="340" y="290" font-size="11" fill="#64748b" text-anchor="end">iSCSI or</text>
<text x="340" y="304" font-size="11" fill="#64748b" text-anchor="end">NVMe/TCP</text>
<!-- Durability for use 1: SeaweedFS -->
<rect x="900" y="134" width="260" height="172" rx="14" fill="#ecfdf5" stroke="#10b981" stroke-width="1.5"/>
<text x="920" y="160" font-size="15" font-weight="700" fill="#065f46">SeaweedFS</text>
<rect x="920" y="172" width="220" height="46" rx="8" fill="#ffffff" stroke="#34d399"/>
<text x="1030" y="191" font-size="12.5" font-weight="600" fill="#065f46" text-anchor="middle">HEAD root (~2 KB)</text>
<text x="1030" y="208" font-size="11" fill="#047857" text-anchor="middle">conditional update on {gen, epoch}</text>
<g>
<rect x="924" y="228" width="30" height="18" rx="3" fill="#a7f3d0"/>
<rect x="960" y="228" width="30" height="18" rx="3" fill="#a7f3d0"/>
<rect x="996" y="228" width="30" height="18" rx="3" fill="#6ee7b7"/>
<rect x="1032" y="228" width="30" height="18" rx="3" fill="#a7f3d0"/>
<rect x="1068" y="228" width="30" height="18" rx="3" fill="#6ee7b7"/>
<rect x="1104" y="228" width="30" height="18" rx="3" fill="#a7f3d0"/>
</g>
<text x="1030" y="264" font-size="11.5" fill="#047857" text-anchor="middle">immutable 4 MiB chunks, shared</text>
<text x="1030" y="281" font-size="11.5" fill="#047857" text-anchor="middle">snapshot / fork = copy the root</text>
<text x="1030" y="298" font-size="11.5" fill="#047857" text-anchor="middle">resume on another host at epoch + 1</text>
<line x1="802" y1="286" x2="896" y2="220" stroke="#0f766e" stroke-width="2" marker-end="url(#arrowG)"/>
<text x="852" y="232" font-size="12" font-weight="600" fill="#0f766e" text-anchor="middle">cut</text>
<text x="852" y="276" font-size="10.5" fill="#0f766e" text-anchor="start">changed</text>
<text x="852" y="289" font-size="10.5" fill="#0f766e" text-anchor="start">chunks</text>
<!-- Durability for use 2: replicas -->
<rect x="900" y="326" width="260" height="104" rx="14" fill="#fffbeb" stroke="#f59e0b" stroke-width="1.5"/>
<text x="920" y="352" font-size="14" font-weight="700" fill="#78350f">Optional replicas (RF=2 / 3)</text>
<text x="920" y="374" font-size="11.5" fill="#92400e">ship by LSN · durable barrier</text>
<text x="920" y="394" font-size="11.5" fill="#92400e">best_effort · sync_quorum · sync_all</text>
<text x="920" y="414" font-size="11.5" fill="#92400e">catch-up or rebuild · epoch-fenced</text>
<line x1="802" y1="300" x2="896" y2="370" stroke="#b45309" stroke-width="2" marker-end="url(#arrowA)"/>
<text x="840" y="352" font-size="12" font-weight="600" fill="#b45309" text-anchor="middle">replicate</text>
<!-- Caption -->
<text x="40" y="472" font-size="12.5" fill="#64748b">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).</text>
<!-- footer -->
<text class="ink2" x="40" y="548" font-size="13">The same core serves Kubernetes volumes through the CSI driver (iSCSI or NVMe/TCP; alpha in v1.0.0).</text>
</svg>

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

+51 -12
View File
@@ -12,17 +12,21 @@ microVMs (4 vCPU, 4 GiB, guest kernel 6.1). The snapshot, fork and cut numbers
come from a host-side proxy, described with their table. Each number is the
median of 3 runs. They are measurements, not SLOs.
**Workspace workloads, Seaweed Block disk vs a local file-backed disk** (one
bare-metal host; NVMe/TCP loopback; seconds):
**Workspace workloads, Seaweed Block disk vs a local file-backed disk** (run
`swbd0a-r5`, 2026-11-15; a pre-release build, commit `f7a6305`, with
`--durable-impl walstore`, the local engine that the released `walstore-chunk`
path builds on; one bare-metal host; NVMe/TCP loopback; seconds). The first two
columns time the operation itself; the last two add the guest `syncfs` that
followed it, recorded separately:
| Workload | Seaweed Block | Local disk |
|---|---|---|
| `npm ci` (617 packages, offline) | 2.14 | 2.14 |
| `git clone` (Go 1.23 repository, local) | 7.10 | 6.99 |
| Untar 5,000 files | 0.31 | 0.31 |
| Untar a 100,000-file tree | 1.10 | 1.06 |
| `find` + `stat` over 100,000 files (cold) | 0.32 | 0.33 |
| 2,000 × create + write + `fsync` | 14.33 | 6.09 |
| Workload | Seaweed Block | Local disk | Seaweed Block with `syncfs` | Local disk with `syncfs` |
|---|---|---|---|---|
| `npm ci` (617 packages, offline) | 2.14 | 2.14 | 2.90 | 2.36 |
| `git clone` (Go 1.23 repository, local) | 7.10 | 6.99 | 8.01 | 7.23 |
| Untar 5,000 files | 0.31 | 0.31 | 1.07 | 0.49 |
| Untar a 100,000-file tree | 1.10 | 1.06 | 1.32 | 1.17 |
| `find` + `stat` over 100,000 files (cold) | 0.32 | 0.33 | | |
| 2,000 × create + write + `fsync` | 14.33 | 6.09 | 14.34 | 6.09 |
- Metadata-heavy agent workloads run at local-disk speed, because the guest
kernel absorbs metadata and the block device only sees batched writes.
@@ -34,6 +38,25 @@ 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 an early FUSE prototype on the same host** (same
run, `swbd0a-r5`; the comparator is a host-side FUSE prototype built on the
SeaweedFS filer, not a released product and not FUSE file systems in general;
seconds, median of 3; its times change by less than 0.01 s with `syncfs`):
| Workload | Seaweed Block | FUSE prototype | Factor | Seaweed Block with `syncfs` | Factor with `syncfs` |
|---|---|---|---|---|---|
| `npm ci` (617 packages, offline) | 2.14 | 11.81 | 5.5× | 2.90 | 4.1× |
| `git clone` (Go 1.23 repository, local) | 7.10 | 37.09 | 5.2× | 8.01 | 4.6× |
| Untar 5,000 files | 0.31 | 19.28 | 62× | 1.07 | 18× |
| Untar a 100,000-file tree | 1.10 | 47.54 | 43× | 1.32 | 36× |
| 2,000 × create + write + `fsync` | 14.33 | 14.32 | 1.0× | 14.34 | 1.0× |
- Metadata-heavy work was 4 to 36 times faster on the block disk with the final
flush included (5 to 62 times for the operation alone); `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 +111,22 @@ 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, single-replica volumes, the same holder and object store;
each run injected a process kill during a snapshot, a kill during a write, and a
pause of the object store during a snapshot; process faults only, not a
power-loss test):
- 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.
- Four of the five runs failed other checks: checks of operation outcomes
(snapshot, move and restore results), including a restore target that could
not be read and a restore whose outcome stayed unresolved. These are separate
from the write-loss check above and were not found to be write loss; for the
unresolved restore, the absence of loss was not established.
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.