Solved Load Balancing LVM Drives

floyd

Verified User
Joined
Mar 29, 2005
Messages
6,171
I am running Virtualizor to manage VPSs. I have a single volume with multiple pv's. The pv's are actually raid1 mirrored. So I have 2 drives raid1 and then 2 more drives that are raid1. I created the LVM with the raid1 arrays. So in the end pvs looks like this

[root@server201 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/md120 VolGroup00 lvm2 a-- <931.38g 0
/dev/md121 VolGroup00 lvm2 a-- 828.81g <10.19g

It fills up the first device first and then starts on the second. The problem is the I/O can get very high on the first device depending on what a VPS may be doing. I would like to balance the I/O.

In my reading it seems like I should create a striped volume. Does this sound like I am on the right track? I want redundancy and I/O load balanced. The below should create a volume called lv_data in volume group VolGroup00 using the raid devices md124 and md125 and it should be striped so that it uses both devices evenly.

lvcreate -n lv_data --size 100G -i 2 -I 128k VolGroup00 /dev/md124 /dev/md125

Please let me know if this seems correct.
 
Last edited:
yes, only way it to create something like RAID 10, when mirrored volumes combined to stripe.
 
Correct. You'll end up with 2 raid arrays in raid 1 taking care of the redundancy and the lvm stripe (-i 2) to possible duplicate the iops of a single array or an unstriped LV.

But keep in mind that blocksizes and type of access will ultimately determine the effectiveness of the load balancing.
 
I just didn't want to end up with a heavily loaded device when I have another completely empty device available. Thanks. I will mark this "Solved" but of course others can continue to make comments if they have any other ideas.
 
Back
Top