[dm-crypt] aes-xts-plain with aes_x86_64 makes my SSD 5x slower than my encrypted HD

Pasi Kärkkäinen pasik at iki.fi
Sun Aug 12 14:49:29 CEST 2012


On Sun, Jul 22, 2012 at 12:07:58PM -0700, Marc MERLIN wrote:
> 
> I got a new Samsumg 830 512GB SSD which is supposed to be very high
> performance.
> The raw device seems fast enough on a quick hdparm test:
> /dev/sda4:
>  Timing cached reads:   14258 MB in  2.00 seconds = 7136.70 MB/sec
>  Timing buffered disk reads: 1392 MB in  3.00 seconds = 463.45 MB/sec <<<<
> 
> which is 4x faster than my non encrypted spinning disk, as expected.
> 
> 
> But once I encrypt it, it drops to 5 times slower than my 1TB spinning
> disk in the same laptop:
> gandalfthegreat:~# hdparm -tT /dev/mapper/ssdcrypt 
> /dev/mapper/ssdcrypt:
>  Timing cached reads:   15412 MB in  2.00 seconds = 7715.37 MB/sec
>  Timing buffered disk reads:  70 MB in  3.06 seconds =  22.91 MB/sec <<<<
> 
> gandalfthegreat:~# hdparm -tT /dev/mapper/cryptroot (spinning disk)
> /dev/mapper/cryptroot:
>  Timing cached reads:   16222 MB in  2.00 seconds = 8121.03 MB/sec
>  Timing buffered disk reads: 308 MB in  3.01 seconds = 102.24 MB/sec <<<<
> 

Hello,

I didn't read the whole thread, but are you aware that many/most SSDs use
internal processors for compression, deduplication, etc .. 

so if you write encrypted data to the SSD, it's not able to do it's internal magic,
and thus you get a lot worse performance compared to non-encrypted data.

So did you try benchmarking with *random* data *without* encryption? 
Also always first write to the disk, and only read after it has been already written to.

-- Pasi



More information about the dm-crypt mailing list