Let’s tally up.
For reference, this is one of a series of posts regarding compression testing on zpools:
- Experimenting with compression off
- Experimenting with compression=lz4
- Experimenting with compression=zstd
- Compression results – you are here
Samsung-SSD-870 4TB SSD
For the Samsung-SSD-870 4TB SSD no compression we had:
- 2:34 = 154s
- 2:32 = 152s
- 2:30 = 150s
- 3:52 = 238s
- 4:46 = 286s
- 4:16 = 256s
- 4:15 = 255s
- 4:15 = 255s
- 4:49 = 289s
With lz4 we have:
- 2:01 = 121s
- 2:02 = 122s
- 2:04 = 124s
- 2:05 = 125s
- 3:08 = 188s
- 3:07 = 187s
- 3:00 = 180s
- 3:16 = 196s
- 3:11 = 181s
With zstd we got:
- 1:51 = 119s
- 1:47 = 107s
- 1:45 = 105s
- 1:45 = 105s
- 1:51 = 119s
- 2:36 = 156s
- 2:36 = 156s
- 2:27 = 146s
- 2:33 = 153s
The zpool sizes:
Samsung-SSD-870-no-compression 3.62T 324G 3.31T - - 0% 8% 1.00x ONLINE - Samsung-SSD-870-compression-lz4 3.62T 191G 3.44T - - 0% 5% 1.00x ONLINE - Samsung-SSD-870-compression-zstd 3.62T 148G 3.48T - - 0% 3% 1.00x ONLINE -
For the base.txz tarball contents, a combination of binary and some text, zstd is the clear winner here. Faster and more compressed.
Samsung-SSD-980-PRO 1TB NVMe
For no compression we had:
- 1:42 = 102s
- 1:44 = 104s
- 1:45 = 105s
- 1:44 = 104s
- 1:42 = 102s
- 1:44 = 104s
- 1:43 = 103s
- 1:42 = 102s
- 1:48 = 108s
For lz4:
- 1:42 = 102s
- 1:42 = 102s
- 1:41 = 101s
- 1:43 = 103s
- 1:43 = 103s
- 1:42 = 102s
- 1:42 = 102s
- 1:43 = 103s
- 1:48 = 108s
For ztd:
- 1:42 = 102s
- 1:40 = 100s
- 1:35 = 95s
- 1:32 = 92s
- 1:33 = 93s
- 1:33 = 93s
- 1:30 = 90s
- 1:33 = 93s
- 1:31 = 91s
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT Samsung-SSD-980-PRO-no-compression 928G 324G 604G - - 0% 34% 1.00x ONLINE - Samsung-SSD-980-PRO-compression-lz4 928G 191G 737G - - 0% 20% 1.00x ONLINE - Samsung-SSD-980-PRO-compression-zstd 928G 148G 780G - - 0% 15% 1.00x ONLINE -
Compressed and lz2 are nearly the same. ztd wins again on both speed and compression.
Samsung-SSD-990-EVO 4TB NVMe
With no compression:
- 1:46 = 106s
- 1:44 = 104s
- 1:43 = 103s
- 1:43 = 103s
- 1:42 = 102s
- 1:42 = 102s
- 1:43 = 103s
- 1:42 = 102s
- 1:43 = 103s
With lz4 compression:
- 1:46 = 106s
- 1:48 = 108s
- 1:48 = 108s
- 1:42 = 102s
- 1:42 = 102s
- 1:42 = 102s
- 1:43 = 103s
- 1:42 = 102s
- 1:43 = 103s
With zstd:
- 1:30 = 90s
- 1:29 = 89s
- 1:30 = 90s
- 1:30 = 90s
- 1:28 = 88s
- 1:28 = 88s
- 1:28 = 88s
- 1:28 = 88s
- 1:27 = 87s
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT Samsung-SSD-990-EVO-no-compression 3.62T 324G 3.31T - - 0% 8% 1.00x ONLINE - Samsung-SSD-990-EVO-compression-lz4 3.62T 191G 3.44T - - 0% 5% 1.00x ONLINE - Samsung-SSD-990-EVO-compression-zstd 3.62T 148G 3.48T - - 0% 3% 1.00x ONLINE -
Again, zstd for the win.
My conclusion: zstd wins. And I should be using the 4TB NVMe with zstd for my FreshPorts development nodes.












For testing compression, yes caching can impact the work to read from original disks; consider shutting down ARC for related pools if its impact in the tests is not part of what you want to measure. If you were not reading from cache then you should think about if the read source was a bottleneck. With zstd the speed of decompression should be much faster that compression. Timing a cp command is not adequate to get proper time measurements since the cp command will return before the data is actually written to disk. If you copy enough data in the transfer then you can make that be a mathematically insignificant part of the test. With zstd compression setting increasing you should see write speeds rapidly fall. Decompression speed (assuming compressed records) will usually increase as compression setting increases but only up to a point. Using zstd outside of ZFS (=newer copy) had maximum decompression speed around compression 12-15 on my hardware if memory serves. I think last I ran that the standalone zstd didn’t have multithreaded decompression while ZFS imitates it by passing multiple records to multiple threads for compression and decompression steps. As such, maximum throughput impact of these settings will be dependent on both the performance and count of CPU cores that are available. If memory serves, hyperthreading cores did not benefit these tasks but I didn’t test limiting ZFS compression threads to < or = physical cores only; actually ZFS doesn't stay below total core count on my system for some reason which coupled with any decent zstd compresion setting causes pretty bad lag when it happens.
I think in my last benchmarking effort I was trying to get my time after a zpool sync. I was writing an iterative loop to memory disk test different GELI ciphers+keylengths + ZFS ashift+compression+recordsize settings. I had intention to integrate ZFS encryption into the testing and run similar with GBDE or whatever the other GEOM encryption is but gave up for now as I continued to see difficulty measuring time properly and GELI detatch + create step was exposing a bug.
If I get back to it then I need to later follow up with similar measurements on physical hardware (at least of any values near interesting ranges from memory tests) and I too should have shut down ARC for aspects where I am not measuring impacts on ARC.