[dm-crypt] Latency penalty
ibobrik at gmail.com
Fri Sep 22 04:25:06 CEST 2017
Thank you for your substantive reply. My apologies for not including
benchmark output initially, I neglected this detail as not very
important given other numbers attached.
Here's what I have:
$ sudo cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 1014096 iterations per second
PBKDF2-sha256 632434 iterations per second
PBKDF2-sha512 420776 iterations per second
PBKDF2-ripemd160 569878 iterations per second
PBKDF2-whirlpool 196804 iterations per second
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 485.8 MiB/s 1666.9 MiB/s
serpent-cbc 128b N/A N/A
twofish-cbc 128b N/A N/A
aes-cbc 256b 359.1 MiB/s 1258.6 MiB/s
serpent-cbc 256b N/A N/A
twofish-cbc 256b N/A N/A
aes-xts 256b 1402.3 MiB/s 1422.9 MiB/s
serpent-xts 256b N/A N/A
twofish-xts 256b N/A N/A
aes-xts 512b 1073.8 MiB/s 1097.8 MiB/s
serpent-xts 512b N/A N/A
twofish-xts 512b N/A N/A
>From what I see here, I should be getting around 1073MB/s for reads.
In my first email I linked two graphs that show relation between block
size and linear read speed:
* No FS: https://i.imgur.com/yar1GSC.png
* XFS: https://i.imgur.com/OQk6kDo.png
In neither case I'm bottlenecked on CPU (hovering around 30% between
kworkers). How come I can't read at device speed with 1MB block size
but can with 1GB?
I also mentioned that I used in-memory loopback device as a base for
LUKS and was able to get up to 850MB/s reads, where I presumably hit
single CPU limit.
In addition we checked completely different hardware (latest top
macbook pro running stock xubuntu in a vm). There we've got 2700MB/s
from "cryptsetup benchmark", 812MB/s from a raw block device and
551MB/s from a LUKS device. These numbers do not add up for me.
More information about the dm-crypt