Skip to content

lab: io and build, what a running workspace's I/O and build cost the host (#563) - #671

Open
aledbf wants to merge 2 commits into
mainfrom
lab/563-io-tax
Open

aledbf wants to merge 2 commits into
mainfrom
lab/563-io-tax

Conversation

@aledbf

@aledbf aledbf commented Nov 23, 2026

Copy link
Copy Markdown
Member

Why

The goal is a cold boot to the first SSH login in under 100 ms. This PR does not move it. It answers a question for spin's metal-or-nested cost model (spin-stack/spin#1652, #1654): what nesting costs a running workspace, as host CPU per unit of work. #563 section 1 asks for it, and no probe measured it.

What

  • io: fio inside the guest against a raw disk attached after the boot, as spin attaches a workspace's disks. One job a row: 4 KiB random read and write at QD1 and QD32, 1 MiB sequential read and write at QD8, each time-based (runtime, default 10 s, no ramp). It records IOPS, MiB/s, completion latency p50/p99, and the CPU each GiB moved took, QEMU's (every thread, /proc/PID/stat) and the guest's (/proc/stat busy).
  • build: go build cmd/go with an empty cache and its sync, inside the guest, on an attached ext4 disk holding the host's Go toolchain (go.mod's toolchain). It records wall time, QEMU's CPU and the guest's.
  • --edit fio: fio 3.43, pinned in versions.yaml and built by internal/lab/fio.Dockerfile on the guest's Ubuntu, as the bootchart edit builds its binary.

Equal storage. Both probes put their disk on the host's tmpfs. The bench's scratch is local NVMe and bench-metal's is EBS. QEMU writes through the host's page cache (no cache.direct), so a disk on either device would have measured writeback to two different devices beside the hypervisors. On tmpfs every request ends in host memory. What still differs between the two hosts is the path through one hypervisor or two. Which device a workspace should live on is a separate question (#563's NVMe-metal option).

The results go to docs/boot-time.md in this PR once the bench and bench-metal runs are in.

Verification

  • go tool task lint test green locally.
  • Laptop smoke runs (leads only). Every job of io and build ran at 1 and 4 vCPUs, and nothing was lost.

🤖 Generated with Claude Code

aledbf and others added 2 commits November 23, 2026 14:58
…host (#563)

#563's first section asks what nesting costs a running workspace, not its
boot: the host CPU each unit of work takes, nested against metal. Two
probes measure it.

io runs fio inside the guest against a raw disk attached after the boot,
one job a row: 4 KiB random read and write at 1 and 32 in flight, 1 MiB
sequential at 8. It records IOPS, MiB/s, completion latency, and the CPU
each GiB moved took, QEMU's (every thread, /proc/PID/stat) and the
guest's. fio is the new fio edit, built from a release versions.yaml pins.

build times `go build cmd/go` with an empty cache inside the guest, on an
attached ext4 disk holding the host's Go toolchain, and records QEMU's and
the guest's CPU over it.

Both disks are raw files on the host's tmpfs. The bench's scratch is NVMe
and bench-metal's is EBS, and QEMU writes through the host's page cache,
so either device would have been measured beside the hypervisors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#563)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant