Perplexity公开了Computer Agent沙箱SPACE的架构细节,双快照加Btrfs写时复制让创建延迟降了60%以上,适合想了解长会话代理如何高效管理资源的开发者。
Perplexity Computer Agent的沙箱平台SPACE由技术架构师Zibi Braniecki主导设计。为解决长会话场景下的资源浪费问题,SPACE采用两种快照:磁盘快照频繁运行而不暂停VM,用于回滚文件系统变化;完整检查点捕获暂停的VM内存和进程状态,上传至对象存储供任意节点恢复。基于Btrfs的写时复制机制,沙箱创建变为元数据操作,生产环境中位创建延迟从185ms降至60ms,P90从447ms降至89ms。
Follow @zbraniecki, the key technical architect of Perplexity Computer agent’s sandbox platform SPAC...
Follow @zbraniecki , the key technical architect of Perplexity Computer agent’s sandbox platform SPACE! Zibi Braniecki @zbraniecki Our team had to build a novel sandbox solution to handle the needs of Computer. One Computer session can run for days and pause while it waits for a user. Keeping its VM alive wastes memory and compute and restoring from the filesystem alone also loses running processes and memory. SPACE uses two kinds of snapshots. Disk snapshots run frequently without pausing the VM and let us roll back filesystem changes. Full checkpoints are less frequent and capture the paused VM, including its memory and process state. When a session is suspended, we upload its full checkpoint to object storage. We only mark it restorable after every artifact has landed. Any node can then fetch the filesystem delta and VM state, so recovery does not depend on the original machine. Btrfs makes this cheap enough to run continuously. Templates, snapshots, and forks share the same extents until something writes to them. Creating a sandbox becomes a copy-on-write metadata operation instead of a full image copy. On production traffic, median creation latency fell from 185 ms to 60 ms. P90 fell from 447 ms to 89 ms. 🔗 View Quoted Tweet 💬 6 🔄 5 ❤️ 67 👀 11595 📊 11 ⚡