HW and SW RAID performance tuning on NTFS volumes

1. Introduction

We will describe how to setup NTFS block size under Windows system to achieve better write performance on Software and Hardware RAID 5 and RAID 6 arrays.
From the tests that we performed it seems that there is performance drop while NTFS block size isn't configured properly according to chunks size and amount of disk drives in array.
We came across some tips regarding block size for NTFS file system calculations and our performance tests have confirmed that those calculations can increase write performance under Windows while using iSCSI volume on SW/HW RAID 5 and RAID 6. Unfortunately this solution applies only for RAID arrays which have max 17 disk drives in RAID 5 and 18 disk drives in RAID 6.

To optimize write performance on iSCSI volumes with NTFS file system which are located on hardware-based RAID or software-based RAID you need to perform the steps described in the next chapters.

2. Optimizing partition starting location (offset) under Microsoft Windows system.

Please follow these steps to optimize partition location:

2.1. Calculating starting location (offset) of partition under Microsoft Windows system.

To ensure that partition is properly aligned with a stripe unit boundary from RAID array you need to divide the size of the stripe unit by the starting offset of the RAID disk group. Please use the following formula:
((partition offset) * (disk sector size)) / (stripe unit size)

Note: Disk sector size and stripe unit size must be in bytes (B) or in kilobytes (KB)

Example 1 of alignment calculations in bytes (B) for 64KB stripe unit size and drive with 512 bytes disk sector size:
(63*512)/65536 = 0.4921875
(64*512)/65536 = 0,5
(128*512)/65536 = 1 (properly aligned partition offset is 128)

Example 2 of alignment calculations in kbytes (KB) for 64KB stripe unit size and drive with 512 bytes disk sector size:
(63*0.5)/64 = 0.4921875
(64*0.5)/64 = 0,5
(128*0.5)/64 = 1 (properly aligned partition offset is 128)

Example 3 of alignment calculations in bytes (B) for 256KB stripe unit size and drive with 4096 bytes disk sector size:
(63*4096)/262144 = 0.984375
(64*4096)/262144 = 1 (properly aligned partition offset is 64)

Please note that the number of disk in the array group does not affect the partition alignment. The factors that affect partition alignment are stripe unit size and partition starting offset.
TIP: The best solution is to create the disk partition and to set a starting offset to 2048 (1 MB). A starting offset of 2048 sectors covers most stripe unit size scenarios.

2.2. Aligning disk partition using diskpart tool under Microsoft Windows system

From the command prompt, type diskpart to run disk partition tool. In diskpart prompt type the following commands:
>list disk (to receive summary information about each of the disks that are installed)
>select disk (to focus on the disk where you want to create partition)
>create partition primary align=1024

Notes:
- When you executes the last command, you may receive a message that resembles the following:
"DiskPart succeeded in creating the specified partition."
-  The align= number parameter is typically used together with hardware RAID Logical Unit Numbers (LUNs) to improve performance when the logical units are not cylinder aligned. This parameter aligns a primary partition that is not cylinder aligned at the beginning of a disk and then rounds the offset to the closest alignment boundary.
- number is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. The command fails if the primary partition is not at the beginning of the disk. If you use the command together with the offset =number option, the offset is within the first usable cylinder on the disk.

>exit

3. Optimizing block size of NTFS file system under Microsoft Windows system

Please follow these steps to optimize block size of NTFS file system:

3.1. Calculating block size of NTFS file system under Microsoft Windows system.

To ensure that NTFS block size is properly configured you need to calculate cluster size for the NTFS volume over SW/HW RAID 5 or RAID 6 array. Please use the following formula:

- For SW/HW RAID 5:
NTFS block size = RAID-5 chunk size * (count of disk in array - 1)

- For SW/HW RAID 6:
NTFS block size = RAID-6 chunk size * (count of disk in array - 2)

Example 1: NTFS block size calculations for RAID 5 array with 3 disk in array and chunk size 32 KB:
32K * (3 - 1) = 64K
In this example we need to setup 64K block size for NTFS file while formatting partition under Microsoft Windows system.

Example 2: NTFS block size calculations for RAID 6 array with 4 disk in array and chunk size 16 KB:
16K * (4 - 2) = 32K
In this example we need to set minimum 32K block size for NTFS file while formatting partition under Microsoft Windows system. We mentioned the minimum block size because you can also set higher block size for NTFS like 64K in this example. The higher block size value doesn't affect write performance, only lower value does.

So the problem is when you have 17 disks in RAID 5 array. In this case you need to setup 4 KB chunk size for RAID array because maximum block size value for NTFS file system is 64K
4K * (17-1) = 64K
For this example the only proper value for NTFS block size is 64K

4. Conclusions

- the best way to cover most stripe unit size scenarios is to create partition with starting offset of 2048 (1 MB)
- for large amount of disks in array the chunk size must be low enough to match the block size calculation between 512B to 64KB
- for RAID 5 array the amount of disks in array must be odd number
- for RAID 6 array the amount of disks in array must be even number



Article ID: 1393
Last updated: 15 Mar, 2013
Revision: 1
Information -> General info -> Performance -> HW and SW RAID performance tuning on NTFS volumes
https://kb.open-e.com/hw-and-sw-raid-performance-tuning-on-ntfs-volumes_1393.html