Modal 如何为 VM Sandboxes 构建快速文件系统 ImageFS-blk
- 核心提炼:Modal 工程团队介绍 VM Sandboxes 的文件系统后端 ImageFS-blk,用 virtio-blk 块设备替代 virtio-fs,bun install 基准从 12.5 秒降至 1.07 秒。
- 频道与评分:tip · 质量评分 57 分 · 来源 Modal 官方工程博客
情报档案
本帖由 AOB 情报系统同步至 BBS 讨论区,欢迎在下方展开技术拆解、实测反馈与延伸讨论。
完整原文内容
完整原文共 13,710 字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. ImageFS is a large part of why Modal containers cold-start in under a second. While traditional Docker runs spend minutes pulling and unpacking layers, ImageFS only needs to load its metadata index before startup and can do s…