系统与数据库2022dl.acm.org
我的 VM 比你的容器更轻(也更安全)
My VM is lighter (and safer) than your container (2017)
专业 · 约 50 分钟读完前置知识:操作系统与虚拟化基础、Xen 架构、unikernel 概念
导读
这篇论文研究轻量级虚拟机能否在保持强隔离安全性的同时,达到接近容器的轻量和快速启动。作者提出基于 Xen 与精简 unikernel 的 LightVM 方案,试图把 VM 的启动开销压到毫秒级,从而挑战“容器一定比 VM 更轻”的常识。
HN 关注点:标题极具挑衅性,触及容器与虚拟机在性能、安全隔离和开发体验上的长期争论;评论还延伸到 unikernel、Firecracker/Kata 以及 AWS Lambda 的真实实现。
HN 评论精选
这几条评论里:质疑 2 补充 1 亲历 1
亲历轻量 VM 在小规模和开发体验上仍不成熟,卷共享等基础功能缺失。
我很想看看精简 VM 会走向何方。个人不用 Kubernetes,它不适合我几乎全是单服务器的客户项目,直接跑 podman systemd 单元或 docker-compose 更合理。从这个角度看,我试过 Firecracker、Kata Containers 等,面向小规模开发的体验还不够好,或者可能永远不会到位,因为参与者瞄准的是 AWS、Fly.io 等别的场景;卷共享之类功能也不支持。我个人觉得 Docker 的架构有点让人反感,Podman 工具链还差一点但很接近了。说实话容器和 VM 我都不太在意,除了 VM 声称更安全这点不错;我也喜欢折腾这些东西,但它们对周末玩玩来说还是太粗糙。有人在搞小规模轻量 VM 部署吗,比如 homelab 或玩具项目?体验比容器更好吗?
bongobingo1查看英文原文
I'm quite interested in seeing where slim VM's go. Personally I don't use Kubernetes, it just doesn't fit my client work which is nearly all single-server and it makes more sense to just run podman systemd units or docker-compose setups. So from that perspective, when I've peeked at firecracker, kata containers, etc, the "small dev dx" isn't quite there yet, or maybe never will get there since the players target other spaces (aws, fly.io, etc). Stuff like a way to share volumes isn't supported, etc. Personally I find Dockers architecture a bit distasteful and Podmans tooling isn't quite there yet (but very close). Honestly I don't really care about containers vs VMs except the VM alleges better security which is nice, and I guess I like poking at things but they're were a little too rough for weekend poking. Is anyone doing "small scale" lightweight vm deployments - maybe just in your homelab or toy projects? Have you found the experience better than containers?
质疑标题容易误导,论文实际讨论的是 unikernel。
标题有点标题党(什么?VM 怎么可能比容器更轻)。这篇论文讲的是 unikernel。
fnord123查看英文原文
Title is kinda clickbaity (wha-? how can a VM be lighter than a container). It's about unikernels.
补充希望复用 Dockerfile 工作流构建 VM,VMware 曾尝试但未延续。
这让我想起 2015 年 DockerCon 上 VMware 的展台挺有意思。他们基本上在 VMware 之上实现了 Docker API,所以能用 Dockerfile 等构建和部署 VM。我以前偶尔搜过,似乎已经不存在了。对我来说 Docker 最好的一点是构建 docker 镜像并通过 git 分享构建过程。如果能拿同样的 Dockerfile 轻松转向 VM 就很好。
xahrepap查看英文原文
This reminds me: in 2015 I went to Dockercon and one booth that was fun was VMWare's. Basically they had implemented the Docker APIs on top of VMWare so that they could build and deploy VMs using Dockerfiles, etc. I've casually searched for it in the past and it seems to not exist anymore. For me, one of the best parts of Docker is building a docker-image (and sharing how it was done via git). It would be cool to be able to take the same Dockerfiles and pivot them to VMs easily.
质疑论文把 Lambda 误称为 CaaS,而 Lambda 实际就是其所述的轻量 VM(Firecracker)。
这篇论文的参考文献一直把 AWS Lambda 错误描述成“容器即服务”技术,但实际上 Lambda 正是他们描述的那种轻量 VM——https://aws.amazon.com/blogs/aws/firecracker-lightweight-virtualization-for-serverless-computing/
JStanton617查看英文原文
This paper references consistently mischaracterizes AWS Lambda as a "Container as a Service" technology, when in fact it is exactly the sort of lightweight VM that they are describing - https://aws.amazon.com/blogs/aws/firecracker-lightweight-virtualization-for-serverless-computing/
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
- 自称作者的回复
- 代码
- 视频与演讲
- 评论区提到的论文
历次讨论
- 2022Hacker News 讨论帖309 分 · 105 评
- 2024Hacker News 讨论帖168 分 · 174 评
同领域还值得读
I/O 比 CPU 更快——让我们划分资源并消除操作系统抽象
I/O Is Faster Than CPU – Let’s Partition Resources and Eliminate OS Abstractions
指出在现代服务器硬件上 I/O 速度已接近甚至超过 CPU,传统操作系统抽象反而成为瓶颈。
系统与数据库2019 · 817 分 · 277 评进阶 · 约 30 分钟编辑精选使用 io_uring 的高效 I/O
Efficient IO with io_uring
由 Linux 内核开发者 Jens Axboe 撰写,介绍 Linux 新的异步 I/O 接口 io_uring。
系统与数据库2019 · 426 分 · 96 评进阶 · 约 45 分钟编辑精选线程对大多数用途而言是个坏主意(1995)
Threads Are a Bad Idea for Most Purposes (1995)
这篇 1995 年的文章由 John Ousterhout 撰写,讨论为什么线程对大多数用途而言是坏主意,并主张事件驱动编程通常更简单、更高效。
系统与数据库2017 · 423 分 · 382 评进阶 · 约 25 分钟编辑精选学习型索引结构之论证
The Case for Learned Index Structures
提出把索引看作一种"模型":既然 B-tree 等结构本质上是在学习数据的分布,就可以用机器学习模型(如回归模型、神经网络)来近似键到位置的映射,从而替代 B-tree、哈希索引…
系统与数据库2017 · 398 分 · 66 评 · 引用 25进阶 · 约 60 分钟编辑精选FoundationDB:一个分布式、解耦的事务型键值存储
FoundationDB: A distributed, unbundled, transactional key value store
介绍 FoundationDB:一个分布式、解耦设计的事务性键值存储。
系统与数据库2021 · 283 分 · 99 评进阶 · 约 90 分钟编辑精选