We could save petabytes of cache storage with Zstandard and Pingora

blog.cloudflare.com

88 points by torutofu 2 days ago


r3trohack3r - 8 hours ago

Tangentially related, I applied a similar approach to compress the npm registry by over 90% on disk a few years back. Since most versions of a package are similar, you can delta encode them first and then compress them. The deltas are small and compress well as a collection with the original source files.

For another use case, prior to compressing, I’ve applied a rolling hash to deterministically split the file. Then compressed the chunks and stored them in a CID filesystem. The result is that files that are largely similar share compressed chunks.

There are a lot of things we can do to be substantially more efficient with the computers we have, but engineers often cost more than hardware. With recent supply chain constraints that calculus is changing!

thinkindie - 10 hours ago

Why not serving files compressed if the client supports it even though the origin served an uncompressed file?

CodesInChaos - 10 hours ago

I'm confused by how this affects range requests. Without compression, those can be easily satisfied by reading the relevant part of the cached complete file. But how are they handled now? The article claims "range requests remain unchanged", but I don't see how that's possible if the cache no longer stores the uncompressed data.

MayeulC - 10 hours ago

> We initially considered limiting transcoding to popular content

Weird, I would have compressed cold content instead, if the goal was to save on CPU time during decode.

zahlman - 8 hours ago

It could save PyPI petabytes per month of bandwidth, too. (But it seems like this is also caused by broken CI systems failing to cache things locally.)

nijave - 8 hours ago

Curious how this application scheme compares to filesystem + transport compression. You'd end up potentially compressing and decompressing more often but the higher software doesn't need to know what's happening and the compression happens in kernel space.

ie btrfs

You could also layer on out of band dedupe and probably push out cache updates with btrfs snapshots although maybe that ends too convoluted

- 10 hours ago
[deleted]
- 9 hours ago
[deleted]