Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Modal builds ImageFS-blk block-based filesystem for VM Sandboxes

AI summary

Modal published an engineering post on how it reworked its filesystem stack for VM Sandboxes. The first design bridged guest VMs to its ImageFS lazy-loading filesystem through virtio-fs, but metadata operations had to cross the VM boundary for authority — Modal says a single chown took three host round trips and 99 µs. The team moved to a virtio-blk block-device model, keeping ext4 and metadata inside the guest while the host serves blocks, producing ImageFS-blk. Modal reports its bun install benchmark fell from 12.5 seconds to 1.07 seconds, and says VM Sandboxes are generally available on the ImageFS-blk backend.

In-depth insight

Modal says everything in a Sandbox depends on the speed of its filesystem, and that with prefetching in place it was back to sub-second cold starts on the new backend.

At Modal, we like to think that we know a thing or two about squeezing nanoseconds out of systems. We love to obsess over making our systems performant and capable from the ground up, and we have to! We build for the thousands of GPUs waiting for that latest RL rollout, for the millions of agent sessions waiting on the next tool call, and even for the human waiting for their project to compile. To us, it’s all the same: make stuff go really fast.

We recently shipped VM Sandboxes, supporting ever more sophisticated agentic workloads at scale, and with the same performance expectations that came with our gVisor-based platform. A fundamental building block of a Sandbox is its filesystem: everything in the Sandbox depends, in one way or another, on the speed of its filesystem. Today, we’ll be talking about how we evolved our filesystem stack to become the performant backbone behind VM Sandboxes.

Background: ImageFS and fast cold starts

We solved the “container filesystem” problem in April 2022 by shipping ImageFS, our distributed lazy-loading filesystem for containers. In a nutshell, ImageFS works by pulling only the minimum amount of metadata upfront, mounting it through a Rust-based FUSE (Filesystem in Userspace) server, and then presenting it to the container. ImageFS lazily fetches file contents from a tiered content-addressed cache, from local memory, to regional CDNs, all the way up to global blob storage. ImageFS also implements smart prefetching in the background, so accesses almost always hit files already sitting on local disk or in memory.

#Modal#ImageFS#ImageFS-blk#VM Sandboxes#virtio-fs#virtio-blk#OverlayFS#ext4#FUSE

Original · 9 min readRead the original
Group chat

No comments yet. Start the conversation.