
How we could save petabytes of cache storage with Zstandard and Pingora
Cloudflare prototyped a system called Cache Transcoding that uses the Zstandard (zstd) algorithm to compress eligible assets within its cache. The architecture trades a minor increase in CPU usage for significant reductions in storage and cross-data center bandwidth.
Why it matters
With rising memory costs, this efficiency allows Cloudflare to increase cache density on existing hardware. This reduces the likelihood that useful customer content is evicted from the cache to make room for new data.
The details
Compressible text like HTML, JSON, CSS, and JavaScript represented 67.3% of requests and 22.3% of bytes in traffic samples. In a controlled test corpus, eligible assets compressed by roughly 2.8 times. The system's encoding cost is 4.31 ns per byte, while decoding is 1.56 ns per byte. The prototype was validated using over one million requests across 10 cache servers.
What's next
Cloudflare plans to evaluate higher zstd levels and test a broader range of content types and object sizes.
Show entities and relationshipsHide entities and relationships
In this article
Products
Companies
People
Key connections
By encoding eligible assets with Zstandard inside Pingora
Yann Collet works at Facebook
Zstandard... developed by Yann Collet at Facebook
Zstandard competes with Brotli
it compressed data 42% faster than Brotli
produced files 11.3% smaller than gzip
Cloudflare uses Prometheus
correlated each request across request logs, Prometheus metrics
Cloudflare uses Jaeger
correlated each request across request logs, Prometheus metrics, and Jaeger traces
Get the weekly recap
The stories like this one, picked and explained — once a week, straight to your inbox.