I'm experiencing slowness with an encrypted filesystem. Here are the details:
# /dev/sdd: TOSHIBA PX05SVQ192B AX02 /dev/sdd # gdisk -l /dev/sdd GPT fdisk (gdisk) version 0.7.1 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sdd: 3750748848 sectors, 1.7 TiB Logical sector size: 512 bytes Disk identifier (GUID): 51E5679B-EFA3-446F-8D55-8FAC33EB8322 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 3750748814 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB) Number Start (sector) End (sector) Size Code Name 1 2048 3750748814 1.7 TiB FD00 Linux RAID
I set up the encryption like this:
cryptsetup -y create -c aes-cbc-plain -s 256 -h ripemd160 data_crypt /dev/sdd1
Here are the test results with hdparm (slowness is also perceived also under a real load):
# hdparm -t /dev/sdd1 /dev/mapper/data_crypt /dev/sdd1: Timing buffered disk reads: 2362 MB in 3.00 seconds = 787.18 MB/sec /dev/mapper/data_crypt: Timing buffered disk reads: 1458 MB in 3.00 seconds = 485.34 MB/sec
I'm running kernel 3.18.7.
CPUs (2) are:
model name : Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
I know encryption can slow things down a bit, but this is larger than I expected. I've used cryptsetup many times without anything of this magnitude.
Can anyone offer advice on how to troubleshoot this?
Edit: I also tried doing the same thing over a loopback device in RAM:
[root@testsedbd tmp]# hdparm -t /dev/loop0 /dev/mapper/ram_crypt /dev/loop0: Timing buffered disk reads: 4094 MB in 2.16 seconds = 1892.83 MB/sec /dev/mapper/ram_crypt: Timing buffered disk reads: 1606 MB in 3.00 seconds = 534.89 MB/sec