AI 精选动态
智能评分 60
Browser Use 优化嵌套 VM 唤醒速度
AI 推荐理由
展示了嵌套虚拟化场景下通过大页内存减少页面错误的实战案例,为 AI Agent 云端浏览器基础设施提供可复用的优化思路。核心解读
Browser Use 在 AWS EC2 上运行 Firecracker 微型 VM 以承载浏览器会双层虚拟化导致页面错误开销大。其工程团队发现唤醒时 72% 的暂停源于页面错误,通过将内存加载粒度从 4 KB 增大至 2 MB(类似透明大页),将冷启动唤醒时间从 9.8 秒降至 3.1 秒。
全文
Gregor Zunic (@gregpr07) 转发了 Arpit Bhayani (@arpit_bhayani) 的帖子:
How do agents use browsers, and how are thousands of them served over the cloud in a memory-efficient way? I was reading through Browser Use's blog and found their answer. It starts with running a VM inside a VM.
Browser Use runs Firecracker VMs on regular EC2 instances, where AWS has already placed your server inside its own VM. Yeah, that is a lot of virtualization. The normal way to run Firecracker is on a bare-metal server, where you rent the entire physical machine. But running it on regular EC2 is cheaper and easier to set up.
So every browser session becomes a VM inside a VM. The downside is that any request from the inner browser VM now has to pass through two layers to reach the host, not one, and that extra hop costs time.
The place this shows up most is memory.
A browser VM does not start fresh each time; it wakes up from a snapshot that was paused right before Chromium opens. The first time it touches a piece of memory after waking up, the host has to load that memory back in. This is a classic page fault.
With two layers, each page fault has to cross both of them, so it costs more, and a browser waking up touches a lot of memory at once.
Early on, page faults made up 72% of all the pauses the VM had to take to communicate with the host. So the fix they applied was simple: instead of loading memory in small 4 KB chunks, the VM now loads it in 2 MB chunks, 512 times larger (similar to transparent huge pages).
Larger chunks mean fewer page faults, and fewer page faults mean fewer expensive trips across the two layers. This one change brought the wake-up time down from 9.8 seconds to 3.1 seconds.
Classic CS is always super interesting and evergreen. Hope you also found this interesting.