[PLUG] striping in LVM or md?

Eric Wilhelm scratchcomputing at gmail.com
Wed Jun 6 20:39:16 UTC 2007


Hi all,

I've got four SATA disks and want to setup a raid 10 with md.

I'll be using md to create two mirror pairs.

I'm trying to decide whether I'm better off using lvm or md for the 
striping.  From my reading, lvm will parallelize writes across pv's, 
but I can't find any sort of definitive answer as to whether md is 
significantly faster at striping than lvm.  If the answer is yes, then 
I guess I build the whole thing with md.

But if there is little or no performance difference between md and lvm 
striping, then I have to wonder whether lvm should be involved.

It looks like managing a collection of disks as one logical volume is 
just as manageable with md as with lvm.  Where lvm comes into play is 
if I decide to allocate multiple LV's on a single PV.  That is, it 
seems that striping would be faster as pure-lvm if I am already using 
lvm to allocate multiple LV's (because it eliminates one layer of md), 
but assuming no logical volume subdivisions, I would guess that a 
purely md setup would prevail.

Summarizing, I know I'm going to create these mirrors with md:

  A:= md raid1 of disks sda and sdb
  B:= md raid1 of disks sdc and sdd

Then I want to stripe them together as either:

  V:= md raid0 of A+B
or
  V:= lvm VG of A+B

And I'm pondering possibly

  V1:= lvm-defined LV
  V2:= lvm-defined LV
  (etc.)

But if I do make LV's, then the md raid0 is an extra layer:

  A:= md raid1 sda+sdb
  B:= md raid1 sdc+sdd
  V:= md raid0 A+B
  V':= lvm VG of V
  V1:= lvm LV of V'
  V2:= lvm LV of V'

vs using md only for the mirroring:

  A:= md raid1 sda+sdb
  B:= md raid1 sdc+sdd
  V:= lvm VG of V
  V1:= lvm LV of V
  V2:= lvm LV of V

vs the "maybe I only need one mount point anyway" md-only answer:

  A:= md raid1 sda+sdb
  B:= md raid1 sdc+sdd
  V:= md raid0 A+B
  mount V

(though this stripe-to-single-lv could also be done in lvm)

So, what's the best performance?  How much flexibility/functionality do 
I lose to do without lvm?  I've been using lvm for a while (strictly in 
"bag of disks with multiple lv's" mode), but this is my first forray 
into md and I've decided that it's probably time for some redundancy.

Because I have data on these disks and need to keep the server going, I 
can't exactly take an afternoon and benchmark it each way without 
spending all of the time moving data around and probably dropping 
something (I have backups, but some of this is just big deb/cpan 
mirrors and other various stuff that I would rather not juggle/re-pull 
from the net today.)  Thus, I'm seeking some best-guess 
recommendations.

Thanks,
Eric
-- 
Atavism  n:  The recurrence of any peculiarity or disease of an ancestor
in a subsequent generation, usually due to genetic recombination.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------



More information about the PLUG mailing list