首页 | 水果短剧 | 博客 | 论坛 | 交友 | 黄页 | 聊天室 | 游戏 | 寄快递 | 登入邮箱 用户中心 | 云浏览器 | ClaudeBot [Bot] | 退出 | 简体 | English
首页 > 时政 > Trending News

Cloudflare Reclaims 100 TB of RAM by Optimizing Consistent Hashing

🤖 AI 辅助采编👤 编辑部筛查📄 原文来源见正文
PHP 安全服务 · 免费扫描网站 PHP 漏洞 → 一键修复 → 修复验证报告(PHP Patch Assurance) 免费扫描 →
🔊
每篇文章,都有双人深度解读 Every Article Gets a Two-Host Deep Dive
听到焦点,听出门道,发现新闻价值! Discover the Real Value Behind the News
试听 →
简体版 繁体版 分页: 1 / 1
华人空间新闻 官方账号 ✍️ 周六 10月 24, 2026 8:57 am #1
Summary
InfoQ Homepage News Cloudflare Reclaims 100 TB of RAM by Optimizing Consistent Hashing Oct 24, 2026 2 min read Follow us on Cloudflare recently docume…
InfoQ Homepage

News

Cloudflare Reclaims 100 TB of RAM by Optimizing Consistent Hashing

Oct 24, 2026

2
min read

Follow us on

Cloudflare recently documented how it reduced the memory footprint of its internal load-balancing service by more than 100 TB by optimizing the Rust implementation of consistent hashing in pingora-ketama. The changes compacted hash-ring entries and used statistical analysis of hash distribution and collision rates to reduce the number of hashes per backend by about 90% while preserving load-balancing accuracy.

Cloudflare relies on consistent hashing in its Pingora Backend Router to distribute cacheable requests across servers, but supporting weighted servers and different feature combinations required many hash rings, significantly increasing memory usage. The team identified excessive memory usage coming from its pingora-ketama consistent-hashing data structures, prompting an investigation into their design and optimization.

Cloudflare applied probability theory to consistent hashing to determine the minimum number of hash points needed to achieve the required distribution, allowing the team to significantly reduce the size of the hashing structures while maintaining the required distribution.

Kevin Guthrie, principal distributed systems engineer at Cloudflare, Mariia Iurchenko, senior software engineer at Cloudflare, Zaidoon Abd Al Hadi, systems engineer at Cloudflare, and Ivan Babrou, performance engineer at Cloudflare, write:

Each step down in error margin requires (almost) an order of magnitude increase in the number of hashes per server, so adding more hashes yields less and less improvement.

Source: Cloudflare blog

Adding more hashes produced diminishing improvements in load distribution, with the final 90000 hashes improving the error by only 0.7%, and the team used the analysis to reduce the number of hashes per server by 90%. The birthday paradox, which describes the unexpectedly high probability of collisions in a set of randomly chosen values, also explains why collisions become increasingly likely as the number of 32-bit hash points grows, introducing additional distribution error.

The team also optimized the Rust data structures storing the remaining hashes: the existing representation used an 8-byte Point, even though the hash and server index could be represented in just 6 bytes, further reducing memory usage. Guthrie, Iurchenko, Abd Al Hadi, and Babrou add:

There was one more problem: changing the hash ring changes where some cacheable requests go. Even if the new ring is better, switching the whole network at once would effectively invalidate almost all cached content. It would turn a memory optimization into an apocalyptic increase in origin traffic.

The new implementation was rolled out gradually alongside the existing ring to limit cache churn and origin traffic spikes.

Source: Cloudflare blog

In popular Hacker News and Reddit discussions, many developers debate why consistent hashing remains useful despite its overhead and how it differs from request hashing. User Teanut writes:

It's fun seeing what little changes at massive scales can do. Good use of math to justify the changes, too.

The Pingora Backend Router effort is not the only one by Cloudflare to optimize memory usage at scale: in August, the company described how its DNS team reduced the memory footprint of its cache through a series of data-structure optimizations.

About the Author

Renato Losio

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers.

View an example

Source: InfoQ
扫码分享
扫码分享本文
打赏给华人空间
打赏
有粉丝喜欢你的作品,你就能收到打赏!
创作者平台 点击了解,加入,创作,圈粉,有赏!
简体版 繁体版 分页: 1 / 1
eBay拍卖狙击神器 — 最后一秒自动出价,永远不超价获胜
华人空间用户专享:前100名6个月免费 · 30天免费试用,随时取消
免费试用 →