Testing Native ZFS Encryption Speed (Ubuntu 22.04)

With the new Ubuntu LTS release, it came time to repeat my ZFS encryption testing. Is ZFS speed better, worse, or the same?

I won’t go into the test procedure much since I explained it back when I did it the first time. Outside of really minor differences in the exact disk size, procedure didn’t change. What did change is that I am not doing it on virtual machine anymore.

These tests I did on Framework laptop with i5-1135G7 processor and 32GB of RAM. It’s a bit more consistent setup than the virtual machine I used before. Due to this change, numbers are not really comparable to ones from previous tests but that should be fine – our main interest is in the relative numbers.

First of all, we can see that CCM encryption is not worth a dime if you have any AES-capable processor. Difference between CCM and any other encryption I tested is huge with CCM being 5-6 times slower. Only once I turned off the AES support in BIOS does its inclusion make even a minimal sense as this actually improves its performance. And no, it doesn’t suck less – it’s just that all other encryption methods suck more.

Assuming our machine has a processor made in the last 5 or so years, the native ZFS GCM encryption becomes the clear winner. Yes, 128-bit variant is a bit faster than 256-bit one (as expected) but difference is small enough that it probably wont matter. What will matter is that any GCM wins over LUKS. Yes, reads are slightly faster using standard XTS LUKS but writes are clearly favoring the native ZFS encryption.

Unless you really need the ultimate cryptographic opacity a LUKS encryption brings, a native ZFS encryption using GCM is still a way to go. And yes, even though GCM modes are performant, we still lose about 10-15% in writes and about 30% on reads when compared to no encryption at all. Mind you, as with all synthetic tests giving you the worst figures, the real performance loss is much lower.

Make what you want of it, but I’ll keep encrypting my drives. They’re plenty fast.


PS: You can take a peek at the raw data if you’re so inclined.

2 thoughts to “Testing Native ZFS Encryption Speed (Ubuntu 22.04)”

  1. Since you’re running RaidZ on 6 concurrent LUKS containers it’s not really much of a surprise that it’s slower.

    Could you do the same test without RaidZ? Many run ZFS on a single disk. Of course you then lose the self-repair feature, but you still get the benefits of compression, snapshots, etc. – so this is still a valid setup for desktop machines.

  2. I might look into this for the next round of testing. However, I would be surprised if results differed a lot when it comes to ratios; i.e., I believe 10% speed difference will still be a 10% speed difference since these measurements were done in memory and thus disk throughput wasn’t a limiting factor.

    I did test a single disk ZFS setup on the physical disk back with 0.8.4. At that time, Luks was actually better according to in-memory tests and what I discovered was that it was better on physical disk too with a similar ration.

    That said, since encryption does make use of a specific CPU instructions, any test I make won’t necessarily mean anything for you as your CPU/OS might deal with AES operations differently thus resulting in different speed. I would always advise testing it yourself (actual commands are in linked document) and not trusting people speaking on the Internet. :)

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.