Benchmarking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Is there a preferred way to benchmark a given system's performance with dm-crypt independent of the hard disk? Dm-crypt so far seems to have negligible performance impact, but I'm wondering if this would continue to be the case if I used faster disks.

Here's what I've tried so far:

(Test 1)
flanders1:~# dmsetup create zero0
0 10485760 zero
-----
flanders1:~# dmsetup create enc_zero0
0 10485760 crypt aes-cbc-plain 689bf2bb1c6e2e1fdbca825395d3fd66 0 / dev/mapper/zero0 0 flanders1:~# dd if=/dev/zero of=/dev/mapper/enc_zero0 bs=1K count=4194304
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 73.6978 seconds, 58.3 MB/s



If I understand how the zero target works, this should determine the maximum rate that the CPU can churn out encrypted blocks, correct?


I was a bit worried about using raw block writes to measure performance because it seems for some reason block devices are much slower when used as a raw device rather than as a filesystem.

For example: (Test 2)
flanders1:~# dmsetup create enc
0 10485760 crypt aes-cbc-plain 689bf2bb1c6e2e1fdbca825395d3fd66 0 / dev/sda6 0
flanders1:~# dd if=/dev/zero of=/dev/mapper/enc bs=1K count=4194304
4194304+0 records in
4194304+0 records out
4294967296 bytes (4.3 GB) copied, 325.005 seconds, 13.2 MB/s

Compared with writing a 3.5G file created in filesystem on the same device: (Test 3)
flanders1:~# mkfs -t ext2 /dev/mapper/enc
flanders1:~# mount /dev/mapper/enc /mnt/exp
flanders1:/mnt/exp# dd if=/dev/zero of=/mnt/exp/test bs=1K count=3670016
3670016+0 records in
3670016+0 records out
3758096384 bytes (3.8 GB) copied, 58.7224 seconds, 64.0 MB/s


The difference between Test 2 and Test3 suggests that using writes to a raw block device (such as a device backed by the zero target) might not be a fair way to measure the performance of the encryption layer.

Does anyone know why using the block device directly is slower than using the FS? Does the FS do some sort of block layout optimization that isn't done when using the device directly? Is using the zero device a fair way to measure the performance of dm-crypt separately from the hard disk?

In case it's useful, I'm running Debian Etch, kernel 2.6.18-4-686. The machine has 1G of memory.


Thanks for any help,


Andrew Miklas


---------------------------------------------------------------------
dm-crypt mailing list - http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx


[Index of Archives]     [Device Mapper Devel]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux