So i’ve recently done more research into raid array performance and the variables that impact speed. I’ve found some really good articles regarding this discussing mainly chunk size but also stripe width, strides, and all kinds of fun terms you didn’t know existed. Plus, I found some useful info on how to properly format a raid array for optimaal perf!

  1. Disk Performance, Part 2: RAID Layouts and Stripe Sizing
  2. RAID setup and ext* formatting.
  3. Setting up a Linux mdadm raid array with 4k sector disks and LVM.
  4. Here’s a great forum thread on HardForum!
  5. Making more sense of where the superblock can/should go
  6. Some help calculating raid level space

From these articles, the just of the important points:

  • Use a larger stripe size (chunk size) for larger data sets.
  • You need to check on your filesystem settings when formatting to ensure alignment is properly defined.
  • You can change how the superblock is setup on the array (front or back) with mdadm
  • The calculations:

    block size (file system block size, ex. 4096)
    stripe size (same as mdadm chunk size, ex. 512k)
    stride: stripe size / block size (ex. 512k / 4k = 128)
    stripe-width: stride * #-of-data-disks (ex. 4 disks RAID 5 is 3 data disks; 128*3 = 384)
    

I will leave you with an interesting article about one man’s quest to properly align his drives..

Example Tutorial

  1. Partition disk gpt:
[email protected]:~# parted -a optimal /dev/sdb
(parted) mklabel gpt                                                     
(parted) unit s
(parted) mkpart primary 2048s 100%
(parted) align-check opt 1
1 aligned
(parted) set 1 raid on
(parted) quit
  1. Create array:
mdadm --create --metadata 1.0 --verbose /dev/md127 --chunk=512 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
  1. Format array:
mkfs.ext3 -v -m 0 -b 4096 -E stride=32,stripe-width=64 /dev/md0
Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.