Hacker News
We could save petabytes of cache storage with Zstandard and Pingora
r3trohack3r
|next
[-]
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!
oefrha
|root
|parent
|next
[-]
a_t48
|root
|parent
|next
|previous
[-]
Twirrim
|root
|parent
|next
|previous
[-]
colechristensen
|root
|parent
|previous
[-]
https://joshleeb.com/posts/chunking.html
https://www.usenix.org/conference/atc16/technical-sessions/p...
On the side I'm working on an extension to git-lfs to use fastcdc for both storage and transmission of artifacts to drastically reduce size and make git-lfs more practical for more things.
thinkindie
|next
|previous
[-]
CodesInChaos
|next
|previous
[-]
gopalv
|root
|parent
|next
[-]
Zstd has a seekable format for frames, similar to pigz --independent works.
[1] - https://github.com/facebook/zstd/blob/dev/contrib/seekable_f...
pkulak
|root
|parent
|next
|previous
[-]
kccqzy
|root
|parent
|next
[-]
Given how fast zstd can decompress, this may or may not actually be a win: the time spent waiting for I/O might be so large that the decompression can fit within the wait time.
CodesInChaos
|root
|parent
|next
|previous
[-]
You could split the file into independently compressed blocks as well. But that'd reduce compression rate and require adding some kind of index for seeking.
Or they have an upper size limit for the file size they compress, since large files are rarely compressible text.
In any case it is something that needs the be handled before going live with a compressed cache. But the article sounds like they simply didn't implement compressed caching for those cases, which makes no sense.
genxy
|root
|parent
|previous
[-]
ncruces
|root
|parent
[-]
There's this, but it doesn't seem to be getting much traction: https://github.com/facebook/zstd/tree/dev/contrib/seekable_f...
genxy
|root
|parent
[-]
nijave
|root
|parent
|next
|previous
[-]
Seekable OCI (SOCI) uses an index so I imagine that's an option (real byte range a-b maps to compressed range x-y). Presumably you'd still need to read the header and some additional pieces
mgerdts
|root
|parent
|next
[-]
MayeulC
|next
|previous
[-]
Weird, I would have compressed cold content instead, if the goal was to save on CPU time during decode.
donavanm
|root
|parent
|next
[-]
Then the effective cost of scaling CPU > RAM > storage > network due to power & space limitations. Spending extra processing time on 50% of your content would be wasted effort as its never read again.
And yes, increasing effective storage might increase cache width/lifetime, but its not by that much to dramatically inprove access rates. Especially when most content by unique bytes is compressed audio/video in the first place.
genxy
|root
|parent
|next
|previous
[-]
Zstd 3 to 5 is nearly free in terms of not bottlenecking disk or network. Zstd 12 to 19 gives amazing compression results and still result in speedups when reading from disk. It really is a wonderful all purpose compressor.
One of the nice things about Zstd is if you try to compress an already compressed stream, it short circuits. So even if you are given say HVEC MP4 and run zstd -19 on it, it will "compress" immediately and not DOS your pipeline.
nijave
|root
|parent
|next
|previous
[-]
I think they probably don't care about storage on the devices that do the compressing and are optimizing for quickly pushing hot content to edge locations. So the compression at the source saves bandwidth during the pushing to edge phase and allows the edges to hold more (reducing churn, further saving bandwidth back to the source).
Put a different way, they're trying to make cache evictions cheaper (less bandwidth to refill) and less likely (bigger cache on same disk size)
"Ignore cold assets" makes more sense with that framing
Although if that's the case, the CPU statement still is a bit confusing.
zahlman
|next
|previous
[-]
repsilat
|root
|parent
[-]
nijave
|next
|previous
[-]
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