Skip to content

Sync a job's files before its VM boots - #1585

Open
epompeii wants to merge 1 commit into
u/ep/experiment/runnerfrom
u/ep/experiment/sync
Open

epompeii wants to merge 1 commit into
u/ep/experiment/runnerfrom
u/ep/experiment/sync

Conversation

@epompeii

Copy link
Copy Markdown
Member

The runner now writes a job's files to disk before its benchmark starts, so their writeback no longer runs during the measurement.

Each run unpacks the image's tree and builds the guest's disk just before the boot. Those writes sat dirty in the host page cache, and the kernel wrote them back about 30 s later, so in a run longer than that, hundreds of MiB of writeback ran during the measurement, with a size that follows the image.

How

  • Before the VM boots, the runner calls syncfs on the filesystems of the work dir (the unpacked tree and the staged binaries), the jail root (the kernel, the disk, the results drive), and the blob store, and waits. The pages stay in the page cache, clean, so the guest's reads stay warm.
  • The no-sandbox path flushes the tree and the blob store after the unpack, before the command starts.
  • A failed flush fails the run and names the path.
  • The runner logs Flushed the run's files to disk with flush_ms.
  • Not covered: the jailer copies Firecracker into the chroot and writes the VM config at boot, after the flush: a few MiB, the same for every run.
  • The timeout messages of the VM and no-sandbox paths now name the time the run had, not the whole timeout.

Tests

Unit tests for the flush's order and its failure, and for both timeout messages. New runner scenarios put the tree on its own loop-mounted filesystem, stop the runner at the flush, and require 0 KiB of the kernel and the tree to be dirty; a no-op flush left tens of MiB dirty. The scenario checks also require the flush record before the boot and before the host command.

@epompeii
epompeii added this pull request to stack #1583 November 26, 2026 00:05
@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBencher
Branchu/ep/experiment/sync
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.29 µs
(+1.66%)Baseline: 5.20 µs
5.48 µs
(96.40%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.12 µs
(+1.75%)Baseline: 5.04 µs
5.30 µs
(96.64%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
26.52 µs
(-1.25%)Baseline: 26.85 µs
28.63 µs
(92.61%)
Adapter::Rust📈 view plot
🚷 view threshold
4.65 µs
(+4.00%)Baseline: 4.47 µs
4.73 µs
(98.32%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.67 µs
(+4.48%)Baseline: 4.47 µs
4.73 µs
(98.78%)
🐰 View full continuous benchmarking report in Bencher

@epompeii
epompeii marked this pull request as ready for review November 26, 2026 00:41
@epompeii
epompeii marked this pull request as draft November 26, 2026 13:42
@epompeii
epompeii force-pushed the u/ep/experiment/sync branch from 80646db to faf372e Compare December 1, 2026 19:07
@bencher-cloud

bencher-cloud Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🐰 Bencher Report

ProjectBencher
Branchu/ep/experiment/sync
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.31 µs
(+2.07%)Baseline: 5.20 µs
5.48 µs
(96.79%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.14 µs
(+1.99%)Baseline: 5.04 µs
5.30 µs
(96.88%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
7.64 µs
(-71.56%)Baseline: 26.85 µs
28.63 µs
(26.67%)
Adapter::Rust📈 view plot
🚷 view threshold
4.55 µs
(+1.63%)Baseline: 4.47 µs
4.73 µs
(96.08%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.54 µs
(+1.67%)Baseline: 4.47 µs
4.73 µs
(96.12%)
🐰 View full continuous benchmarking report in Bencher

The runner builds each execution's files just before it runs, most of
all the unpacked image. Those writes sat dirty in the page cache, and
the kernel wrote them back about 30 s later, inside any benchmark that
ran longer than that. The runner now flushes the filesystems that hold
them before the VM boots or the command starts, and keeps the pages
cached. Two timeout messages now name the time the run had, not the
whole timeout.
@epompeii
epompeii force-pushed the u/ep/experiment/sync branch from faf372e to 83d66d4 Compare December 2, 2026 23:07
@epompeii
epompeii marked this pull request as ready for review December 3, 2026 00:30

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