LZ4 Compression enabled by default

Status
Not open for further replies.

Stanri010

Explorer
Joined
Apr 15, 2014
Messages
81
I just installed freenas for the very first time. I hadn't planned on using compression as I was reading that it would negatively affect your performance and I have more than sufficient room. Was the compression algorithm that people were talking about the LZ4 algorithm? How come it is enabled by default right as you create a volume?

Should I keep that on or off?
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Even with incompressible data, you should hardly notice any performance penalty with lz4. It aborts any compression attempt really early if it encounters such data.

For reference, here is the related ticket in the bug tracker: #3872
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah.. funny how people keep throwing that around... but the aborting isn't particularly useful for ZFS storage based writes. Since every single block is a separate compression and potential abort, and you're probably doing 1000s a second(even for a single file since its atomic at the block level), aborting isn't going to be particularly useful or provide any serious performance benefits.
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Can you provide me with a reference that the block-based compression has any noticeable performance impact?

When using compression, ZFS should utilize dynamic block sizing to fit in smaller, compressed blocks. Nonetheless I assume it starts its compression efforts based on the default block size (i.e the incoming chunk of data to be compressed). I'm not sure about the default block size in FreeNAS (I think I remember that it was rather small compared to other OS defaults), but when using for example a default size of 1024 kb, this shouldn't induce too much additional effort to check once in 1 MB for compressibility.

I couldn't find any more specifics in the sources I found:
- Illumos wiki article about lz4: "The extremely high per-core throughput of LZ4 [..]" (indicating actual benefits from multi-threading) and "LZ4's performance on incompressible data is very high".
- LZ4 google code page: "typically reaching RAM speed limits on multi-core systems"
- FreeBSD 10 commit: "delivers very high compression and decompression performance compared to lzjb (>50% faster on compression, >80% faster on decompression and around 3x faster on compression of incompressible
data)"
- Wikipedia article on ZFS (I know, unreliable source): "ZFS uses variable-sized blocks of up to 1024 kibibyte"
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Can you provide me with a reference that the block-based compression has any noticeable performance impact?

Yep.. my e1230v2 saw a decrease that was significantly enough to lower my NFS writes by almost 50%. So when all of these people at iX and elsewhere say "you won't notice" I have to laugh.

When using compression, ZFS should utilize dynamic block sizing to fit in smaller, compressed blocks. Nonetheless I assume it starts its compression efforts based on the default block size (i.e the incoming chunk of data to be compressed). I'm not sure about the default block size in FreeNAS (I think I remember that it was rather small compared to other OS defaults), but when using for example a default size of 1024 kb, this shouldn't induce too much additional effort to check once in 1 MB for compressibility.

ZFS uses a block size that is variable from 512-bytes to 128kB depending on the load. You cannot force a given larger size, you can only set a maximum allowed block size. 1MB would be nice, but that's currently only implemented in zpools that are v32 which is Oracle's implementation only.

I couldn't find any more specifics in the sources I found:
- Illumos wiki article about lz4: "The extremely high per-core throughput of LZ4 [..]" (indicating actual benefits from multi-threading) and "LZ4's performance on incompressible data is very high".
- LZ4 google code page: "typically reaching RAM speed limits on multi-core systems"
- FreeBSD 10 commit: "delivers very high compression and decompression performance compared to lzjb (>50% faster on compression, >80% faster on decompression and around 3x faster on compression of incompressible
data)"
- Wikipedia article on ZFS (I know, unreliable source): "ZFS uses variable-sized blocks of up to 1024 kibibyte"

Yeah.. there's very very little actual data provided to end users. To me this is a disappointment, but it's pretty typical for ZFS.

For example:
  • When people spew shit like "around 3x faster on compression of incompressible data" you've gotta talk about *what* it's 3x faster then. 3x faster than gzip9 compression, even on the most expensive CPU money can buy is still unacceptable speeds.
  • Your google code link mentions single thread performance of 422MB/sec compression on an i5-3340M. I can't find *solid* evidence that LZ4 is actually multi-threaded in the ZFS implementation. But, 422MB/sec is pretty crappy for an i5-3340M in the big picture. Sure, home users won't likely have a problem. But 422MB/sec is 1/2 of a single 10Gb link. And many users with G3220s and the new Intel Atoms are using CPUs that are slower than an i5-3340M, so that's not necessarily a "good thing" anyway. But it may be multi-threaded. It may not. It also may be multi-threaded only in certain circumstances.
In short, trying to sell me on a compression routine where there's very little transparency is pretty disappointing. This is pretty par-for-the-course for ZFS though. It's not a FreeNAS problem in my opinion, except that it's the default.

Also, I firmly believe that compressions should NEVER be enabled by default. And even more so, if it is going to be enabled by default, it should be 100% *blatantly* obvious to the user. For example, during pool creation there's a dropdown to choose compression with the default being lz4. This sneaky enable it and not say a word about it is extremely dishonest. Just look at the 9.2.1 announcement. No comment at *all* about the change in default compression. Conspiracy theorists can now rejoice.

And once a company has shown where it's transparency is or isn't, it's not far fetched to wonder what other things they may be doing behind the scene that you may not be too appreciative of. Some forum users have accused iX of taking a stable product and going to bleeding edge with these changes to the risks not being made known at all unless you look VERY closely and are an advanced user. For example, 9.2.1 brought about the feature flags enable_txg, hole_birth, extensible_dataset, and bookmarks. Those are in the FreeBSD CURRENT branch only according to http://open-zfs.org/wiki/Features. I don't know how much you keep up with the different branches, but CURRENT is for developers only because it may contain serious bugs. Is that the kind of thing *you* want storing your precious data? I'm still on v28 because I'm not interested in these games. I'm also on 9.2.0 because I have to wonder what other BS is being added I don't really want to be involved in.

My trust in this project has rapidly diminished in recent months with many things that have become "standard operating procedures". It's making me wonder when that bug is going to come out that's gonna eat pools everywhere when they release some poorly developed ZFS feature without adequate testing. Talk about the community losing faith in a project. That'll be one for the record books. I don't think it's a matter of if, I think it's a matter of when.

Just look at what has happened in the last 5 months with development of FreeNAS.

  • 9.2.0-RCs had some major bugs. The expectation across the IT industry has always been that RCs should good enough to be a RELEASE version and they're just making sure that there's nothing too nasty before making it official. Instead, 9.2.0 had two RCs, and there was almost a 3rd. Why? Because 9.2.0-RCs had major problems. A lot of people put it on their home servers and had major problems with it that made their server unusable unless they rolled back to 9.1.1.
  • Then, since the community had lost confidence, when 9.2.1-RC came out only a small subset of users were even willing to try it. So 9.2.1 went to RELEASE version, where everyone felt safe that the problems had been worked out. Fast forward through 9.2.1.1, 9.2.1.2, 9.2.1.3 and now 9.2.1.4-beta and the problems are finally almost fixed. I say almost because the 9.2.1.4-beta has more fixes to go before it hits release. Now keep in mind that 9.2.1 came out February 7th. It's April 17th and we're still struggling to get a 9.2.1.x that's keeping people happy. I bet I've posted in at least 20 threads in the last 2 months to go back to 9.2.0 and not try to make 9.2.1 work because the average user can't solve the problems on their own. But tons of users everywhere are stuck with broken servers that are behaving erratically, some aren't even functional, etc for various reasons and don't have a choice to go back to 9.2.0(or earlier).
Mind you, iX guys I've chatted with said they tested 9.2.1 extensively in the lab and never had the problems we've seen in the real world. Some of the guys have said that they are shocked at how messed up 9.2.1.x has been for the end-users. I think they are being honest when they say that(despite what conspiracy theorists might want you to think). So I have to assume that either the QA testing isn't really reproducing good real-world scenarios, the QA testing isn't effective at finding problems, or both. Of course, having to release a 9.2.1.1, 9.2.1.2, 9.2.1.3, and eventually a 9.2.1.4 tends to make me think nothing has changed, no lessons have been learned about whatever processes are being used to vet code, and that makes me even more fearful of what future versions will have in store for some people.

So, based on all of this, here's my prediction for 9.2.2. It's gonna get to RC and everyone's going to be just as fearful of it because faith has been lost from all the other BS users have had to deal with for the last 6 months. 9.2.2 is going to roll out to RELEASE and we're going to see a repeat of 9.2.1's problems. I have no doubt that we'll be telling a lot of people then to go back to 9.2.0 if they can still. Of course, from iXsystem's perspective, "9.2.0 is too old. Die in a fire." Yet plenty of us are still using 9.2.0 because the "upgrades" aren't exactly functional for many people.

One thing is for sure though. Using the community as the QA process is failing miserably. Companies that use the public or community for their QA process that aren't fully transparent, honest, and responsive to user feedback have major problems.

I don't know about the rest of the world, but I don't upgrade my server because its new and shiny and therefore must be better. I upgrade because it *is* better. And so far, 9.2.1.x has been a big fail for many reasons. I thought 9.2.1.4-beta was going to finally be the 9.2.1 release we didn't have. But, apparently the 9.2.1.4-beta still doesn't have all of the big ticket fixes. :(
 

Djbower1

Cadet
Joined
Apr 14, 2014
Messages
2
This is my first ever post on the forum! Hi all :)

Cyberjock, I have now read alot.... of you posts, recommendations etc and you are the only person which seems to give good honest advice. I was considering building a Freenas system for a combination of SMB / home use but after reading your above post I have been put off :( My data is valuable to me!

I was going to build two systems, one 24TB, 32GB, Avoton C2750 or Zeon E3-12??? and a basic replication server for backup + Online Backup. I am really hoping you can convince me its still a good idea. I have a windows background with little to no unix knowledge (But willing to learn)

Before I go spending £2000+ I would really appreciate your input.

Thanks,

Dan
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
Thanks for the long response CJ, even though it got a bit off topic at the end ;)
The small block sizes are unfortunate and 512b blocks probably induce some non-negligible overhead, as you found out by first hand experience.

I won't comment too much on the recent FreeNAS developments and decisions, but you certainly have good points there. However, I also notice that the devs are at least trying to be open and honest about the development progress. If you are a user with some technical background, the bug tracker and code change logs give a good insight into what's actually going on at the moment. While it's incredibly hard to deliver a bug-free product, I can understand that developers should never put the data of their software's users at risk. At the same time it's impossible to test a product like FreeNAS exhaustively, as there are so many unique hardware configurations out there.

Additionally, I remember the bug tracker in earlier FreeNAS versions. There was almost never a response from the devs, a lot of orphaned tickets etc. In my opinion, this chaos and the dev's responsiveness has gotten way better since Jordan is in charge of the project.


Dan, welcome to the forums. But how does this relate to the OP's question about LZ4 compression? You are probably better off starting a new thread.
 

Djbower1

Cadet
Joined
Apr 14, 2014
Messages
2
Hi warri, Sorry it doesn't. Noob stupidity . I will start a new thread reagrding my questions.

Dan
 

Pseudobolt

Dabbler
Joined
Apr 16, 2014
Messages
17
So 9.2.1.4 is out yesterday...

Regarding the compression, I read the manual that it has "negligible performance impact", but now I'm curious... I think I might try benchmarking my setup with compression on vs. off for copying some movie files, and see what difference I get.
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
Yep.. my e1230v2 saw a decrease that was significantly enough to lower my NFS writes by almost 50%.

I'm glad you brought this up.

I've noticed somewhat similar results using my production 9.1.1 server, not quite 50% but slower. While it bought me 1.4 times worth more space, the write penalty was a bit too much to stomach, in my env that is.

At this point, its time for another JBOD or 2 to make up for the space savings that LZ4 had gotten.

I thought 9.2.1.4-beta was going to finally be the 9.2.1 release we didn't have. But, apparently the 9.2.1.4-beta still doesn't have all of the big ticket fixes. :(

Again, glad you brought up this as well. I'm only quoting your last part out of brevity.

Well, to Jordan Hubbards credit he just got to IX and is making what looks like big changes. We should all be lucky that he is on board, I'm very happy at least.

How are you viewing 9.2.1.4 release? Is it closer to what 9.2.1 should have been?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Actually, 9.2.1.4.1 may be.. I don't call it until I've read the complaints for at least a week or two. So far though, 9.2.1.4.1 has a gotten one of the mod's attention because of a few problems he deems as 'severe'. I'm not sure what they are, but I think he's going to provide a followup soon.
 

9C1 Newbee

Patron
Joined
Oct 9, 2012
Messages
485
NOW I see this! SMH. I just made the hop from 8.3 to 9.2.1.4. I created a pool on a single drive to run the jail functions and provide a download space off the 6 disk array. The jail pool was created under 9.2.1.4. I noticed the LZ4 compression. I assumed my fat fingers hit the wrong key when I created the pool. I see it is not the case. Fortunately the 6 disk array is uncompressed as it was made long long ago on a FreeNAS version far far away. I guess I won't upgrade the ZFS version on the 6 disk array in case I decide to revert back. And when I say "decide", what I really mean is cyberjock told me to.
 

James S

Explorer
Joined
Apr 14, 2014
Messages
91
NOW I see this! SMH. I just made the hop from 8.3 to 9.2.1.4. I created a pool on a single drive to run the jail functions and provide a download space off the 6 disk array. The jail pool was created under 9.2.1.4. I noticed the LZ4 compression. I assumed my fat fingers hit the wrong key when I created the pool. I see it is not the case. Fortunately the 6 disk array is uncompressed as it was made long long ago on a FreeNAS version far far away. I guess I won't upgrade the ZFS version on the 6 disk array in case I decide to revert back. And when I say "decide", what I really mean is cyberjock told me to.


As a fairly new user I also noticed the compression appear during the setup. I seem to remember the documentation mentioning a tick box to check for compression and being careful to avoid that. So it was a big surprise to note compression on the drive.

Why do this? This is deeply unhelpful to any user (technically sophisticated or, like me, technically limited). A GUI should do what is says on the proverbial can. This doesn't and so is unhelpful. That said, it seems easy to remove by editing the pool configuration.
 

Pseudobolt

Dabbler
Joined
Apr 16, 2014
Messages
17
I ran some tests with compression on vs off using 5 disks in RAIDZ4+1. (I'm going to rebuild the server with more disks once I get them, but I only have 5 working drives ATM and I'm just playing with it.)

I copied ~ 100GB .tar file of videos and related files from one dataset on my server to two other datasets (one at a time), one with compression and one without. In this setup on my hardware there was not a significant difference in speeds; copying to the compressed dataset was slightly faster, but only by about 3% (15:10 vs 15:43). I think this is because I'm bottlenecked on disk read/write speeds, whereas my CPU usage was relatively low throughout. (Ideally I'd copy between independent hardware instead of within the same pool, but see above re only having 5 drives... I'll retest once I have my full setup going.)

Having said all that, the compression really didn't save me any disk space either with that kind of data (not surprisingly).

Raw results:
Code:
[/mnt/Test_4DR-RAIDZ1/Default] $dd if=MLP.tar of=TestUC/MLP.tar bs=2M
50903+1 records in
50903+1 records out
106751886336 bytes transferred in 943.345697 secs (113163061 bytes/sec)
 
[/mnt/Test_4DR-RAIDZ1/Default] $dd if=MLP.tar of=TestLZ/MLP.tar bs=2M
50903+1 records in
50903+1 records out
106751886336 bytes transferred in 910.277888 secs (117273953 bytes/sec)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
RAIDZ4+1! Wow.. considering RAIDZ3 is the highest possible you've got quite the pool there...
 
Status
Not open for further replies.
Top