logoalt Hacker News

We could save petabytes of cache storage with Zstandard and Pingora

87 pointsby torutofulast Tuesday at 1:41 PM33 commentsview on HN

Comments

r3trohack3ryesterday at 9:56 PM

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!

show 4 replies
thinkindieyesterday at 7:56 PM

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

show 2 replies
CodesInChaosyesterday at 7:54 PM

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.

show 4 replies
MayeulCyesterday at 7:36 PM

> 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.

show 4 replies
zahlmanyesterday at 10:07 PM

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.)

show 1 reply
nijaveyesterday at 9:29 PM

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