RAID Array Stripe Alignment affect Performance

klau1

Member
Oct 2, 2006
29
0
0
Just found out that RAID arrays can have alignment issues, separate from the well known 4K sector issue.

I suspect it to be the cause of slow transfer rates on my Adaptec RAID 3805 RAID6 (5x Hitachi 2TB 7200 RPM) array.

Nodesoft Disk Bench only gets 100MB/s writes and 80MB/s reads (these figures are more in line my Windows File Copy performance)
http://www.nodesoft.com/diskbench

But I don't know why the following benchmarks report so much higher

Atto/HDtach:

ATTOANDHDTachbenchwithRAID63805Hitachi2TB.jpg


Crystal:
CrystalDiskbenchwithRAID63805Hitachi2TB.jpg




However,
I think I have confirmed that my array is not aligned, but am not sure.

State of Array:
aligninfo1-1.jpg



Results:

Alignment Calculator:
http://www.techpowerup.com/articles/other/157
aligncalc.jpg




Alignment Checking Script:
http://www.ocztechnologyforum.com/f...ax-performance&p=518021&viewfull=1#post518021
Device ID: Disk #2, Partition #0
=======================================================
Total Volume Size: 5 TB
Starting Offset: 134235136 (131089 KB)
Partition Alignment: ** NOT ALIGNED!! **





VM Check Alignment Tool:
http://ctxadmtools.musumeci.com.ar/VMCheckAlign/VMCheckAlignment10.html
vmcheckalign.jpg






My Calculation:
Formula: ((Partition offset) * (Disk sector size)) / (Stripe unit size)
Source: http://support.microsoft.com/kb/929491

Partition off set = 134235136b
Disk sector size = 512b
stripe unit size = 262144b
block size = 512b

answer = 262178

This is an integer, thus indicates the array is aligned. But this conflicts with the conclusions of the other calculators, so WTF? I have no idea what I'm doing lol :weep:






Array Info:
Adaptec RAID 3805 RAID6
HD 5x (Hitachi 2TB) Sector Size: 512Bytes
Stripe Size: 256K
Disk Format: GPT
Windows Disc mode, Basic or Dynamic: Basic
 
Last edited:

Bull Dog

Golden Member
Aug 29, 2005
1,985
1
81
I would be inclined to agree your array is not aligned.

Unless I'm horribly mistaken, your Partition offset should be evenly divisible by the stripe unit size. (Partition offset)/(Stripe unit size) = int

On my 5x1TB disk RAID 5 array my starting offset is 138412032 bytes.
I also have a 3x2TB RAID 5 array on another computer and it's offset is 136314880 bytes.

Hope this helps.
 

sub.mesa

Senior member
Feb 16, 2010
611
0
0
You can also use the simple AS SSD to see whether you are aligned. It shows 'OK' in the topleft corner when properly aligned (to 4K blocks anyway).

Having a misaligned RAID5 is even worse than when using other RAID levels.

Furthermore, CrystalDiskMark tests on the filesystem and thus enjoys read-ahead buffering, while HDTach is a raw I/O benchmark that escapes these optimizations. If your hardware controller does not support or have 'read-ahead' disabled, you will see a major difference between raw I/O benchmarks like HDtune and IOmeter, and benchmarks that operate on the filesystem level like CrystalDiskMark, AS SSD, ATTO.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
RAID alignment typically requires a bit of math but being "4k" aligned will be fine normally. Big issues normally appear when you start using larger cluster sizes in NTFS and the NTFS cluster straddles 2 RAID stripes. This can be even worse if you misalign on LUN on a SAN.

Simple way to fix this is to use diskpart to create a partition that is aligned to certain cluster or a multiple ie:

diskpart
select disk 1
create partition primary align=1024

That starts the partition @ 1024k

If you have a SAN using 2MB stripes then
create partition primary align=2048

Then format to NTFS cluster that evenly divides in to the strip / block sizes.

Using align=1024 ->

4k cluster so 1MB / 4KB = 256 so 4k would align with 256 "blocks."

bad example:

create part pri align=1001

(1025024 bytes) / (4096 bytes) = 250.25 the .25 shows you are not aligned.