Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Native ZFS encryption on Unraid - large cpu overhead

Featured Replies

Hi all,

I have recently reshuffled my unraid server with zfs. I went from a non-encrypted zpool to a zpool with almost all datasets encrypted. I noticed a quite significant and non stable overhead on my system (see image with overall load = 85%), when copying my data (large photos of +- 30MB each) back onto the new encrypted zpool from another (single) harddisk.

732921894_Screenshot2023-09-21225735.png.92df8efd0092b6acc85e1c23dd68564c.png

 

As a debugging step I have tried the 'top' command to see what is eating CPU resources, giving me the 'z_wr_iss' process. I read that this process handles the writes to the zpool and also handles the encryption.

My CPU is a AMD Ryzen 5 5500, checking for the encryption hardware give me a positive result:

root@Deimos:~# grep -m1 -o aes /proc/cpuinfo
aes
aes

root@Deimos:~# grep module /proc/crypto | grep -v kernel | sort | uniq
module       : aesni_intel
module       : crc32_pclmul
module       : crc32c_intel
module       : crct10dif_pclmul
module       : ghash_clmulni_intel
module       : sha512_ssse3

 

Then I tried to copy that same data to an unencryted dataset to check if this cpu overhead was due to the encryption. The result is shown in the image with overall load = 30%. So it looks like the encryption is adding a significant overhead!!!

1271757797_Screenshot2023-09-21230938.png.4858fa534119154b8397b4ad21f61e95.png


The system at idle (stopped copy tasks) is shown in the image with overall load = 2%976249608_Screenshot2023-09-21230836.png.09a2c11426b380f26d6b4426c828d29c.png

 

 

Finding out what encryption is used for my datasets:

root@Deimos:/boot# zfs get encryption phobos/nino
NAME         PROPERTY    VALUE        SOURCE
phobos/nino  encryption  aes-256-gcm  -

 

I read that zfs encryption has only a 1-10% performance hit vs. non-encrypted dataset in terms of speed. I read that this encryption could and/or should be handled by the aesni_intel crypto-acceleration-hardware. I copy with rsync.

 

What I'd like to know: is this large overhead normal behaviour for encryption, or is something misconfigured?

Thank you in advance!

 

 

Which Unraid version? There's a zfs bug affecting performance with some CPUs, especially with encryption. 

  • Author

@JorgeB im running the latest stable version at the moment, which is version 6.12.4. I upgraded from 6.12.2 two weeks ago. If this bug is fixed in a later version, I assume that the performance is automatically fixed? E.g. I do not have to reshuffle the data again?

That is the affected release, post the output of:

 

cat /sys/module/zfs/parameters/zfs_vdev_raidz_impl
cat /sys/module/zcommon/parameters/zfs_fletcher_4_impl

 

34 minutes ago, NytoxRex said:

I assume that the performance is automatically fixed?

Correct

  • Author

Running the suggested code

cat /sys/module/zfs/parameters/zfs_vdev_raidz_impl
cat /sys/module/zcommon/parameters/zfs_fletcher_4_impl

 

Gives:

cycle [fastest] original scalar sse2 ssse3
[fastest] scalar superscalar superscalar4 sse2 ssse3

 

Though, I dont really know what this means

AVX2 is not recognized, so it uses a slower implementation, it's this issue:

 

https://github.com/openzfs/zfs/issues/15223

 

Downgrading to v6.12.3 should confirm it's this, but you can also just wait for a newer Unraid release with a newer fixed kernel.

  • Author

Thanks! Ill just wait for the new release. Ill reply to this thread if the issue is resolved.

  • Author

Okay, waiting around for a new version of unraid got me a little impatient... Via the Tools -> Update OS, I reverted back to version 6.12.2. I am happy to report that the encryted datasets can write data much more efficiently now. Here a screenshot of the cpu usage now with the same workload:

1567718209_Screenshot2023-09-24173953.png.0e6097df0e762f03b2e132576e0f6c93.png

This is more in line with my expectation.
Thanks for the help!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.