Cloudflare 用数学+Rust 省出 100TB 内存
推荐指数 66.0 NO. 014 · 2026.09.19
发布2026/09/18Score52Comments7
为什么值得看
Cloudflare 通过优化 Pingora 服务中的单一算法,在全球服务器集群中回收超过 100TB RAM。这对运行大规模分布式系统的团队有直接参考价值——小算法优化在万级节点下会产生指数级资源收益。
编辑判断
Cloudflare 没有透露具体算法细节,但从"math"和内存 footprint 的表述来看,大概率是将精确计数或去重结构换成了 HyperLogLog 或 Count-Min Sketch 这类概率型数据结构。这类替换在广告计数、UV 统计、缓存去重场景非常常见,但多数团队只敢在离线链路用,不敢放核心在线服务。
Pingora 作为 Cloudflare 自研的 Rust 代理框架,已经替代了内部大量 Nginx 实例。如果你在用 Rust 写网关或代理,可以重点看它的内存分配策略——它用了 jemalloc 并做了大量 per-thread cache 调优,这是国内 Rust 网络项目普遍欠缺的。
建议行动:检查你服务中的 HashSet/HashMap 使用场景,评估哪些可以换成 bloom filter 或 sketch 结构,特别是 QPS 高但精度要求 99% 即可的环节。
社区反馈
意见分歧 7 条评论
核心争论:AI辅助编程的命名与边界:'vibecoding'、'AI assisted engineering'还是'aineering'
Was this vibecoded? I hope so, would expect models to be good enough by now, its not that creative.
I think it's more important now than it was last year to differentiate pure yolo vibecoding from "AI assisted engineering" or "AI engineering", I.e. deliberate and careful use of AI to speed up coding but without creating too much slop. Maybe aineering?
AIded development?