Open W9CR opened 3 years ago
I have the same problem on the two Macs I tested, with the same version of ZFS as yours. One is an iMac with an i5-5675R on macOS 10.15.7 (kernel root:xnu-6153.141.43~1/RELEASE_X86_64
), the other is a MacBook Air with an i5-5350U on macOS 10.14.6 (kernel root:xnu-4903.278.70~1/RELEASE_X86_64
).
I tested on a RAM disk (see my script) with dd
from /dev/zero
, and performance on an unencrypted dataset is over 700 MB/s on the iMac, 208 MB/s on the MBA, while on AES-256-GCM (the default) it falls to about 150 MB/s on the iMac and 20 MB/s on the MBA with full CPU usage in both cases.
As a comparison, openssl speed -evp aes-256-gcm
gives 400-1500 MB/s on the iMac and 310-1200 MB/s on the MBA with only a single core saturated in both cases, and I tested on a RAM disk on a Linux VM on the iMac and it gives over 500 MB/s for AES-256-GCM, so it's clearly not a problem of OpenZFS. Maybe this release of OpenZFS on OSX doesn't use AES-NI?
Here are the results for the dd
benchmark:
Running benchmark for noencryption...
10+0 records in
10+0 records out
1048576000 bytes transferred in 1.427054 secs (734783724 bytes/sec)
Running benchmark for aes128ccm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 2.966284 secs (353498177 bytes/sec)
Running benchmark for aes256ccm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 3.687919 secs (284327275 bytes/sec)
Running benchmark for aes128gcm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 6.448514 secs (162607386 bytes/sec)
Running benchmark for aes256gcm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 6.668878 secs (157234244 bytes/sec)
Running benchmark for noencryption...
10+0 records in
10+0 records out
1048576000 bytes transferred in 5.040728 secs (208020742 bytes/sec)
Running benchmark for aes128ccm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 9.648026 secs (108682958 bytes/sec)
Running benchmark for aes256ccm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 9.792953 secs (107074546 bytes/sec)
Running benchmark for aes128gcm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 50.366285 secs (20819006 bytes/sec)
Running benchmark for aes256gcm...
10+0 records in
10+0 records out
1048576000 bytes transferred in 53.425810 secs (19626768 bytes/sec)
And here are the results of openssl speed -evp aes-256-gcm
:
LibreSSL 2.8.3
built on: date not available
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: information not available
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-256-gcm 409696.18k 1008532.69k 1437244.00k 1539713.79k 1580495.42k
LibreSSL 2.6.5
built on: date not available
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: information not available
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
aes-256-gcm 311740.97k 739539.17k 1127034.30k 1191862.55k 1227247.06k
1d90a79
We should now be detecting the correct CPUID features (yikes) and use AESNI when available. This could also be why AVX fails - need to test that separately.
There is a test PKG on the forum for those we can test it:
https://openzfsonosx.org/forum/viewtopic.php?f=26&t=3651&p=11593#p11588
Has this performance issue been fixed in version OpenZFSonOsX-2.1.0-Catalina-10.15?
I have not been able to get on to the openzfsonosx.org forum... site appears to be down.
The website is broken at the moment due to a problem with the server that runs the vm's. If you have any urgent enquires you might want to jump on #openzfs-macos on irc.libera.chat:6697
It's nothing I'd consider urgent... was going to try the test PKG linked above. Is there a way to get that PKG from github?
System information
Summary of Problem
Poor read performance on encrypted ZFS dataset.
I have a 12 disk zraid2 zvol in a zpool. The disks I'm using are ST4000NM0033, Dell branded with Firmware GA6E.
Reading and writing from the non-encrypted dataset works as expected with speeds exceeding 500 mbytes/s.
When reading from the encrypted dataset the performance goes way down, and any random I/O will bring the system to a crawl. Writing to the dataset causes the CPU load to go to 600%. A program such as thunderbird is almost unusable on the encrypted ZFS dataset.
I've tested this against a ZFS dataset with an encrypted APFS container and it has performed much better than native ZFS encryption.
Describe how to reproduce the problem
I created a random 10gb file by concatenating 10 copies of 1g from /dev/urandom
My encrypted pool is mounted on /Users/bryan/ I did the following while logged in as root and no processes were accessing the dataset
Include any warning/errors/backtraces from the system logs
I've attached three spindumps during these operation and one while unison was running. zfs-read-from-crypto-dataset-Spindump.txt zfs-while-unison-running-Spindump.txt zfs-write-to-crypto-big-dataset-Spindump.txt
zpool layout: