Building fast filesystems for VMs
Modal replaced virtio-fs with a custom virtio-blk backend, ImageFS-blk, for its VM Sandboxes. Under virtio-fs every metadata operation crosses the VM boundary: one chown cost three guest-to-host FUSE round trips and six host syscalls. ImageFS-blk synthesizes ext4 inode and extent metadata from lazily loaded image metadata, leaves file data sparse, and serves blocks on demand from a tiered cache. Writes go to a sparse file tracked by a dirty bitmap, giving block-level copy-on-write. Metadata operations now stay in the guest's ext4 journal (chown drops from ~99 µs to ~2.1 µs), bun install runs 12x faster (12.5s to 1.07s), and sub-second cold starts are preserved.
Related posts
- SBD: We Have a Filesystem at Home
Fly.io mediumAdeptFly.io replaced the modified JuiceFS stack behind Sprites with the Sprites Block Device (SBD), which exposes an object storage bucket to the Linux kernel as an NBD block device formatted with ext4. The old design kept data chunks, a Litestream-backed SQLite metadata database and a separate checkpoints database consistent with each other. In writeback mode, a machine killed between recording metadata and uploading a chunk left dangling references that corrupted every clone-based checkpoint. SBD stores its metadata in the bucket beside the blocks, uses a single daemon with a local cache and background uploads, makes checkpoints versioned block snapshots, and verifies every block read back, restarting the Sprite rather than running on an untrusted disk. A torture-test harness driving write/checkpoint/sleep/wake/restore cycles showed SBD to be orders of magnitude more reliable.
- Litestream Writable VFS
Fly.io mediumAdeptLitestream's SQLite VFS now supports an optional write mode and background hydration, built so the Sprites storage stack can serve reads and writes milliseconds after a cold boot without first downloading its JuiceFS block map from object storage. Write mode assumes a single writer, disables polling for remote LTX files, and buffers writes locally, syncing them to S3 about every second. That gives 'eventual durability' that suits Sprites but probably not most applications. Hydration serves reads from object storage while pulling a compacted full copy of the database into a temporary local file, then switches reads to that file once it is ready. Ordinary workloads should keep running Litestream as a sidecar instead.
- Server-side sandboxing: An introduction
Figma easyNovice
Server-side workloads like image processing, parsing and thumbnailing often depend on memory-unsafe C++ libraries with histories of exploitable bugs (e.g. ImageTragick), so Figma isolates them with sandboxing rather than relying solely on preventing vulnerabilities. Three primitives are compared at a high level: VMs (Firecracker via AWS Lambda), containers (nsjail using namespaces, cgroups and seccomp), and direct seccomp syscall allowlists built with libseccomp for pure-computation workloads. Seccomp offers strong security and minimal overhead but high upfront development cost, while containers are easier to ship but have more security pitfalls. A questionnaire covering environment, isolation granularity, latency, cost, development effort and operational ownership helps teams choose an approach.
- Speeding up Deployments with Lazy Image Streaming
Replit mediumAdeptReplit cut cold-boot times for large Deployment container images from 3-4 minutes to under 30 seconds by lazily streaming images through a FUSE filesystem instead of pulling and unpacking every layer up front. They compared the eStargz snapshotter, which requires converting images to a per-file-compressed seekable format with worse compression ratios, against AWS's SOCI snapshotter. SOCI stores separate zTOC metadata with gzip decompressor checkpoints, so existing OCI images can be range-fetched without modification, and Replit chose it. The main tradeoff is slower runtime filesystem access because every FUSE operation crosses between user space and kernel space several times.
- Memory snapshots: Checkpoint/restore for sub-second startup
Modal mediumAdept
Modal cuts serverless container cold starts roughly 2.5x by checkpointing a gVisor container's full process tree and filesystem mutations just before it accepts a request, then restoring it instead of re-running Python's syscall-heavy import path (import torch alone makes 26,000 syscalls through OverlayFS and a FUSE lazy-loading server). Restore speed depends mostly on getting the main process's memory pages into the page cache. gVisor loads pages in the background, prioritizing faulting pages, while the FUSE layer aggressively preloads the pages file. Snapshots are created on demand per worker because of CPU feature, NVIDIA driver and runtime compatibility. GPU state can't be saved, so models are loaded into CPU RAM before the snapshot and moved to the GPU after restore via snap=True/snap=False lifecycle hooks.