Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance of aes-256-ccm #10362

Closed
tochlab opened this issue May 24, 2020 · 4 comments
Closed

Performance of aes-256-ccm #10362

tochlab opened this issue May 24, 2020 · 4 comments

Comments

@tochlab
Copy link

tochlab commented May 24, 2020

System information

Type | Version/Name
Distribution Name | gentoo
Distribution Version |24.05.2020
Linux Kernel |5.4.38-gentoo-x86_64
Architecture | x86_64
ZFS Version | 0.8.4-r0-gentoo
SPL Version | 0.8.4-r0-gentoo

Describe the problem you're observing

SSD: WD BLUE 3D NAND SATA SSD 1 TB (WDS100T2B0A)
CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz

I have about a 200MBytes/s write speed on encrypted(aes-256-ccm) and uncompressed pool and about 500Mbytes/s on the same device using ext4.

Describe how to reproduce the problem

dd if=/dev/zero of=test.bin bs=1M count=32768

I understand that there is some performance penalties due to enabled encryption, but is it normal halving speed on modern CPU with hardware AES and AVX?

@AttilaFueloep
Copy link
Contributor

I understand that there is some performance penalties due to enabled encryption, but is it normal halving speed on modern CPU with hardware AES and AVX?

Unfortunately two factors contribute to suboptimal native encryption performance, the need to handle FPU state inside ZFS due to copyright woes and a mostly C based implementation of the algorithms. If you're interested in the details please have a look at #9749.

A fix for AES-GCM went into 0.8.4, so if you have the chance I'd recommend using AES-GCM in lieu of AES-CCM, that should give you a distinct performance gain. You can do that by creating an aes-256-gcm encrypted dataset and moving your data there (or by restoring from backup into such a dataset).

@scineram
Copy link

Is there no more optimized code available to be used for CCM?

@AttilaFueloep
Copy link
Contributor

@scineram There is, but since CCM is 3-4 times slower than GCM anyhow it didn't seem worth the effort of porting it. See here and above.

@tochlab
Copy link
Author

tochlab commented May 25, 2020

Thanks for detailed response. Switching to GCM helps.

@tochlab tochlab closed this as completed May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants