Earlier quoted context omitted.
I have a ZFS pool with exclusively video files. Probably won't see any benefit in enabling LZ4 there right?
I compression not on by default nowdays? Anyhow, I would not run ZFS with compression disabled completely. There are edgecases where you want it. The meta data? I can't remember the details. At least active the compression that just compresses zeros.
LZ4 – Extremely fast compression
101–110 of 115 posts
Re: LZ4 – Extremely fast compression
#102Earlier quoted context omitted.
"Even storing items in-memory compressed sometimes is profitable" LZ4 is one of the algorithms supported by Zram in Linux. It's fairly popular for people using things like a Raspberry PI that have a smaller amount of RAM.
TIL about zRAM, emailed myself this config to try at work https://www.techrepublic.com/article/how-to-enable-the-zram-...
Re: LZ4 – Extremely fast compression
#103I ported the block format to Rust matching the C implementation in performance and ratio. https://github.com/pseitz/lz4_flex
Re: LZ4 – Extremely fast compression
#104Although implementations arein rust, I assume the provided benchmarks are representative of any optimised implementation...
Many compressor algorithms are compared on several data sets.
The results tables show compressed size, compression and decompression times for a number of normal and pathological cases.
Get a good feel about strengths and weaknesses.
Some algs really go downhill in pathological cases, such as with random data.
Do consider encryption too though you probably want to do that on the compressed data set where possible.
Sometimes external encryption means you will be stuck with something close to pathological...
Re: LZ4 – Extremely fast compression
#105I ported the block format to Rust matching the C implementation in performance and ratio. https://github.com/pseitz/lz4_flex
Has anyone written the appropriate Reader wrappers to use this with file io? (Asking b/c a quick search didn't turn anything up.)
Re: LZ4 – Extremely fast compression
#106Earlier quoted context omitted.
"Even storing items in-memory compressed sometimes is profitable" LZ4 is one of the algorithms supported by Zram in Linux. It's fairly popular for people using things like a Raspberry PI that have a smaller amount of RAM.
Microsoft found that compressed pages were always faster, because added by de-/compression was less than the latency to disk (given a sufficiently fast compression algorithm). As a bonus, it's also faster to read and write compressed pages to disk (if that absolutely has to happen). Zswap is therefore enabled by default on Windows. I configure my own kernel on Arch and Zswap is enabled by default there, too.
Re: LZ4 – Extremely fast compression
#107LZ4 is so fast, that in make sense to use it everywhere over uncompressed data. Even storing items in-memory compressed sometimes is profitable as you can fit more items in memory. Still zstd offers way better compression and got variable difficulty factor: https://github.com/facebook/zstd Decompression is always fast, but you can trade off compression vs. ratio factor. In general if send data over network zstd is qu…
Using LZ4 can easily improve performance even if all data reside in memory. This is the case in ClickHouse: if data is compressed, we decompress it in blocks that fit in CPU cache and then perform data processing inside cache; if data is uncompressed, larger amount of data is read from memory. Strictly speaking, LZ4 data decompression (typically 3 GB/sec) is slower than memcpy (typically 12 GB/sec). But when using e.…
I'm not into C/C++ for years though and now I wouldn't grok the code, sadly.
Re: LZ4 – Extremely fast compression
#108Earlier quoted context omitted.
Microsoft found that compressed pages were always faster, because added by de-/compression was less than the latency to disk (given a sufficiently fast compression algorithm). As a bonus, it's also faster to read and write compressed pages to disk (if that absolutely has to happen). Zswap is therefore enabled by default on Windows. I configure my own kernel on Arch and Zswap is enabled by default there, too.
Pages as in the 8K (for example) data structure used to store portions of files on disk, or pages as in text files? I'm assuming the former but I am not very good with file system internals
Re: LZ4 – Extremely fast compression
#109Earlier quoted context omitted.
>But it's going to have a considerably higher CPU usage as well. I am going to assume in three to four years time this wouldn't be a problem? I mean a 16nm Quad Core ARM Cortex SoC are only $15. Unfortunately no consumer NAS are implementing ZFS. ( TrueNAS offering isn't really consumer NAS )
I am not sure about cheap ARM devices but I am using an old Haswell i5-4670 and it is more than enough. So it won't be issue later. Also, when you are talking about consumer NAS, the real problem is that any low-end systems can saturate the gigabit network (100MB/s) very easily so investing on extra resources for ZFS doesn't make difference. At least a 10Gbe network (which is beyond the average consumer) is required…
I have lz4 enabled and the gigabit link is almost completely saturated when transferring: 119 MB/s out of the total theoretical 125.
No ZIL, no L2ARC devices are attached. That thing is _flying_ as a home NAS.
Re: LZ4 – Extremely fast compression
#110Earlier quoted context omitted.
"Even storing items in-memory compressed sometimes is profitable" LZ4 is one of the algorithms supported by Zram in Linux. It's fairly popular for people using things like a Raspberry PI that have a smaller amount of RAM.
Microsoft found that compressed pages were always faster, because added by de-/compression was less than the latency to disk (given a sufficiently fast compression algorithm). As a bonus, it's also faster to read and write compressed pages to disk (if that absolutely has to happen). Zswap is therefore enabled by default on Windows. I configure my own kernel on Arch and Zswap is enabled by default there, too.
I can't quite see why - perhaps the logic to decide which pages to compress is different, or there is too much code in the swap subsystem that slows down the compression/decompression process...