wiki'd

by JoKeru

Enhance storage performance with LVM Striping

When you write data to an LVM logical volume, the file system lays the data out across the underlying physical volumes. You can control the way the data is written to the physical volumes by creating a striped logical volume. For large sequential reads and writes, this can improve the efficiency of the data I/O.

Striping enhances performance by writing data to a predetermined number of physical volumes in round-round fashion. With striping, I/O can be done in parallel. In some situations, this can result in near-linear performance gain for each additional physical volume in the stripe.

Let's make a simple test using a VM and 2 disks (each disk located on a different Datastore): /dev/sdb & /dev/sdc
[cc lang='bash']
\$ fdisk /dev/sdb # new, primary, 1, type lvm
\$ fdisk /dev/sdc # new, primary, 1, type lvm
\$ pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
\$ pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created
\$ vgcreate vg /dev/sdb1 /dev/sdc1
Volume group "vg" successfully created
\$ lvcreate -n lv_strips -l 50%FREE -i 2 -I 16 vg
Logical volume "lv_strips" created
\$ lvcreate -n lv_default -l 100%FREE vg
Logical volume "lv_default" created
\$ lvs --segments
LV VG Attr #Str Type SSize
lv_default vg -wi-a- 1 linear 8.00g
lv_default vg -wi-a- 1 linear 8.00g
lv_strips vg -wi-a- 2 striped 15.99g

# testing with one thread
\$ iozone -I -t1 -i0 -s800m -r16k -F /dev/mapper/vg-lv_default | grep 'Avg throughput per process'
Avg throughput per process = 101980.33 KB/sec
Avg throughput per process = 98248.98 KB/sec
\$ iozone -I -t1 -i0 -s800m -r16k -F /dev/mapper/vg-lv_strips | grep 'Avg throughput per process'
Avg throughput per process = 99363.76 KB/sec
Avg throughput per process = 93670.05 KB/sec

# testing using two threads
\$ iozone -I -t2 -i0 -s400m -r16k -F /dev/mapper/vg-lv_default /dev/mapper/vg-lv_default | grep 'Avg throughput per process'
Avg throughput per process = 16651.11 KB/sec
Avg throughput per process = 16810.86 KB/sec
\$ iozone -I -t2 -i0 -s400m -r16k -F /dev/mapper/vg-lv_strips /dev/mapper/vg-lv_strips | grep 'Avg throughput per process'
Avg throughput per process = 34267.38 KB/sec
Avg throughput per process = 33828.65 KB/sec
[/cc]

Conclusion:
- Striped LVM is faster than Linear LVM when using more processes than the strips number
- if you have only one process writing on the disk, there is no need for striping

info: http://www.moredevs.ro/profitbricks-storage-boost/

Comments