4K Random Write vs 4K Random Write (4K aligned)

jaydee

Diamond Member
May 6, 2000
4,500
4
81
Can someone explain to me the difference between 4K Random Write vs 4K Random Write (4K aligned) as Anand has them in the test bench? I searched and found this one review (http://www.anandtech.com/show/3618/intel-x25v-in-raid0-faster-than-x25m-g2-for-250/3):

I've had to run this test two different ways thanks to the way the newer controllers handle write alignment. Without a manually aligned partition, Windows XP executes writes on sector aligned boundaries while most modern OSes write with 4K alignment. Some controllers take this into account when mapping LBAs to page addresses, which generates additional overhead but makes for relatively similar performance regardless of OS/partition alignment. Other controllers skip the management overhead and just perform worse under Windows XP without partition alignment as file system writes are not automatically aligned with the SSD's internal pages.

Is this basically saying, if you run WinXP or older, look at the "unaligned" benchmarks, while if you run Vista, Win7, recent Linux kernals or Mac OS, look at the "4k aligned" bench? Can you manually align a partition in WinXP to get the better performance?
 

sub.mesa

Senior member
Feb 16, 2010
611
0
0
NTFS under XP aligns to 512 bytes (sectors). NTFS in Vista/Win7 aligns to 4K blocks. Thus random write can be done in several ways.

Particularly Sandforce/Micron SSD performance crashes when not properly aligned. Also HDDs with 4K sectors require proper alignment.

Even with NTFS that aligns to 4K chunks, that doesn't mean the end offset is always aligned. With true random I/O you won't always be writing in multiples of 4KiB; but also fractions of that block size. So alignment won't be perfect, but if 99% of all I/O is aligned then you should be good.
 

jaydee

Diamond Member
May 6, 2000
4,500
4
81
So, can you manually align WinXP to be 4K (and if so, how)? There seems to be a substantial difference in random write performance. I was looking at getting a Crucial C300 and will be installing WinXP. I'd have to leave all that performance on the table...
 

HendrixFan

Diamond Member
Oct 18, 2001
4,646
0
71
So, can you manually align WinXP to be 4K (and if so, how)? There seems to be a substantial difference in random write performance. I was looking at getting a Crucial C300 and will be installing WinXP. I'd have to leave all that performance on the table...

Windows XP does not support trim. Do not waste new technology on a 10 year old operating system.
 

sub.mesa

Senior member
Feb 16, 2010
611
0
0
NTFS in Windows XP aligns to 512 bytes; nothing you can change about that. Aside from this, it also creates misaligned partitions starting at sector 63. Vista SP1 and later fix this and have NTFS with 4K alignment.
 

skid00skid00

Member
Oct 12, 2009
66
0
0
Jaydee, YES you can align in XP. There's guides on several storage forums on how to do this. Both of my x25-m's are aligned, and even though they are gen1's they are fast.
 

sub.mesa

Senior member
Feb 16, 2010
611
0
0
skid00skid00: you are talking about partition alignment; i am talking about internal filesystem alignment. This is something you cannot tweak, as far as i know. XP NTFS is 512 byte aligned; NTFS is 4K aligned.

You can align the partition, so the filesystem starts at a 'good' offset (= aligned). But that doesn't prevent XP from aligning to 512 byte sectors, which can cause performance issues for example on SSDs.

Intel SSDs are least affected by misalignment, but Sandforce and Micron (Crucial C300) have about 10 times lower performance when not properly aligned. So avoid XP whenever possible; Win7 is much better suited towards SSDs. That said, if you do want to use Windows XP; an SSD is going to give you way more performance than a HDD ever can, and in many ways XP needs the performance more than Win7 as Win7 got SuperFetch which makes Windows depend less on random IOps performance from your system disk, which HDDs truly suck at.

If you want to go rough on benchmarking, try out IOmeter test suite (open source!) - works on windows. You can set alignment and offset and all that kind of thing; just be sure to follow a howto on how to use it for the first time.
 

Cable God

Diamond Member
Jun 25, 2000
3,251
0
71
skid00skid00: you are talking about partition alignment; i am talking about internal filesystem alignment. This is something you cannot tweak, as far as i know. XP NTFS is 512 byte aligned; NTFS is 4K aligned.

You can align the partition, so the filesystem starts at a 'good' offset (= aligned). But that doesn't prevent XP from aligning to 512 byte sectors, which can cause performance issues for example on SSDs.

Intel SSDs are least affected by misalignment, but Sandforce and Micron (Crucial C300) have about 10 times lower performance when not properly aligned. So avoid XP whenever possible; Win7 is much better suited towards SSDs. That said, if you do want to use Windows XP; an SSD is going to give you way more performance than a HDD ever can, and in many ways XP needs the performance more than Win7 as Win7 got SuperFetch which makes Windows depend less on random IOps performance from your system disk, which HDDs truly suck at.

If you want to go rough on benchmarking, try out IOmeter test suite (open source!) - works on windows. You can set alignment and offset and all that kind of thing; just be sure to follow a howto on how to use it for the first time.

This.