This question arose at work — is LVM a performance penalty compared to using straight partitions? To save you the trouble, the answer is “not really”. There is a very small penalty, but as with all benchmarks it does depend on what the benchmark measures versus what your real workload does. In any case, here is a small guestfish script you can use to compare the performance of various filesystems with or without LVM, with various operations. Whether you trust the results is up to you, but I would advise caution.
#!/bin/bash - tmpfile=/tmp/test.img for fs in ext2 ext3 ext4; do for lvm in off on; do rm -f $tmpfile if [ $lvm = "on" ]; then guestfish <<EOF sparse $tmpfile 1G run part-disk /dev/sda efi pvcreate /dev/sda1 vgcreate VG /dev/sda1 lvcreate LV VG 800 mkfs $fs /dev/VG/LV EOF dev=/dev/VG/LV else # no LVM guestfish <<EOF sparse $tmpfile 1G run part-disk /dev/sda efi mkfs $fs /dev/sda1 EOF dev=/dev/sda1 fi echo "fs=$fs lvm=$lvm" sync guestfish -a $tmpfile -m $dev <<EOF time fallocate /file1 200000000 time cp /file1 /file2 EOF done done
fs=ext2 lvm=off elapsed time: 2.74 seconds elapsed time: 4.52 seconds fs=ext2 lvm=on elapsed time: 2.60 seconds elapsed time: 4.24 seconds fs=ext3 lvm=off elapsed time: 2.62 seconds elapsed time: 4.31 seconds fs=ext3 lvm=on elapsed time: 3.07 seconds elapsed time: 4.79 seconds # notice how ext4 is much faster at fallocate, because it # uses extents fs=ext4 lvm=off elapsed time: 0.05 seconds elapsed time: 3.54 seconds fs=ext4 lvm=on elapsed time: 0.05 seconds elapsed time: 4.16 seconds