Partition alignment

Intel Reference

The default file system for Windows Server 2003, NTFS, uses 4 KB clusters by default.
Traditionally,these 4KB clusters take up 8 – 512 Byte sectors. With Intel SSDs, 1 - NTFS cluster takes up less than one NAND page when alignment is correct.
When the alignment is not correct, some of the 4 KB clusters will write across 2 NAND pages.

This is illustrated in Figure 1 using 4 KB pages for clarity:

With an offset of 63 sectors, the first 31.5 KB of drive space is left blank. Then Windows begins to
write clusters, but the physical page of the SSD ends at 32 KB.
Therefore, the cluster is split across 2 pages: 512 Bytes written on the first, 3.5 KB written on the next.

This has a cumulative effect as each subsequent page boundary that is written will have a cluster split across it. Figure 2–1 shows a misaligned partition, figure 2–2 shows a partition properly aligned at 1MB.

Linux cmd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## 2048s = 1MB

$ parted /dev/sda unit s print
Model: ATA INTEL SSDSC2BW12 (scsi)
Disk /dev/sda: 234441648s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 2048s 148072447s 148070400s primary ntfs boot
2 148072448s 189673471s 41601024s primary ext4
3 189673472s 234441647s 44768176s primary ext4

parted /dev/sdxx
(parted) set 1 boot on

#or you can
$ parted -a optimal /dev/sdxx mkpart primary 2048s 100%

mkfs HDD raid

ext4

11 HDD + 1HDD HS Raid6 stripe-size=128K, 11-2p=9, if you stride=9

1
$ parted -a optimal /dev/sdxx mkpart primary 2048s 100%

Warning: RAID stripe-width 128 not an even multiple of stride 9. 128%9=2 128%8=0 ??

1
$ mkfs.ext4 -E stride=8,stripe-width=128,lazy_itable_init=0,lazy_journal_init=0 /dev/sdxx1

xfs

Raid 60 24 HDD ,12HDD/per raid6 (12-2)× 2 , Raid stripe size 64KB

1
mkfs.xfs -f -d sunit=64,swidth=$((64*20)) /dev/sdxx1

Kernel io schdule Read ahead

1
$ echo 1024 > /sys/block/sdb/queue/read_ahead_kb

increasing the maximal I/O queue size (nr_requests)

Improve raid volume bandwidth (raid 6, 11x15k HDDs + 1HS)

1
echo 2048 > /sys/block/sdb/queue/nr_requests