我们将Chrome的状态保存到NVMe,并在500毫秒内恢复。

1作者: Nextbysam4 个月前原帖
我们一直在为人工智能代理构建浏览器基础设施。每个人都会遇到的问题是:你启动 Chrome,登录某个账户,进行一些工作,然后呢?<p>是让虚拟机以每月 30 美元的费用继续运行却什么都不做,还是关闭它并失去当前会话?<p>我们希望在 Chrome 空闲时将其冻结到磁盘,并在恢复时精确回到上次的状态。结果发现这很困难。经过大量尝试不同的浏览器版本和配置后,我们终于在 Orb Cloud 上使用 Playwright 的 Chromium 和 CRIU 实现了这一功能。<p>结果是:导航到 Google,获取一些 cookies,截图,然后冻结。等待。恢复。相同的 cookies,相同的页面,完全相同的截图。我们在 Google、维基百科和 Hacker News 上进行了连续测试——全部通过。<p>Orb-browser 是一个开源代码库。它是一个无头 Chrome,你可以将其置于休眠状态。休眠时不产生任何费用,恢复大约需要 500 毫秒,所有数据都保持完整——cookies、localStorage,以及你所处的页面。浏览器并不知道它曾被冻结。<p>如果你运行的浏览器代理每小时活跃 5 分钟,那么你只需为 5 分钟付费,而不是 60 分钟。<p>代码库链接:https://github.com/nextbysam/orb-browser。
查看原文
We&#x27;ve been building browser infrastructure for AI agents. The problem everyone hits: you spin up Chrome, log into something, do some work, and then what?<p>Keep the VM running at $30&#x2F;month doing nothing, or kill it and lose the session.<p>We wanted to freeze Chrome to disk when it&#x27;s idle and bring it back exactly where it left off. Turns out this is hard. After a lot of trial and error with different browser builds and configurations, we got it working with Playwright&#x27;s Chromium on Orb Cloud using CRIU.<p>The result: navigate to Google, pick up some cookies, take a screenshot, freeze. Wait. Restore. Same cookies, same page, identical screenshot. We ran it back-to-back on Google, Wikipedia, and Hacker News — all pass.<p>Orb-browser is the open source repo. It&#x27;s a headless Chrome you can put to sleep. It costs nothing while sleeping, wakes in ~500ms, and everything is intact — cookies, localStorage, the page you were on. The browser doesn&#x27;t know it was frozen.<p>If you&#x27;re running browser agents that are active 5 minutes per hour, you pay for 5 minutes, not 60.<p>repo: https:&#x2F;&#x2F;github.com&#x2F;nextbysam&#x2F;orb-browser.