Storage Misalignment has been a performance issue that has been around for a long time. It can contribute to as much as a 30% loss in performance is not resolved. It has always been a consideration in the physical environments for many years and virtual environment are no immune. There have been posting in the past by folks like, Duncan Epping, Vaughn Stewart, Chad Sakac, and Joshua Townsend. But I keep getting questions and finding that folks are still either struggling with misalignment or still have not taken misalignment in consideration when looking at performance best practices. So let’s take a look misalignment once more…
Data can be segmented or grouped together in what we call partitions. Then to these partitions are laid out in such a way as to optimize how data is written or read to rotating media or Solid State technology. Now that new hard drives rely on a different sector base servers and desktops may not recognize the change and this may produce further performance degradation. To add to the complexity RAID sets also need to be aligned as well. With the increased adoption of SSD and Flash technology this also comes with unique performance considerations for alignment.
When partitions are not properly aligned performance degradations have been measured as high at 30%. This degradation can cost companies company and degrade the amount of business a company can transact at a time. So it is very important to make sure partitions are aligned properly.
What causes partitions to be misaligned? A physical sector size is typically not 512 byte and the given software does not know it. The latest drives have a physical sector size of 4096 bytes and operates 4k chunks of data but some hardware and software are unaware of this and they may appear as the usual 512 byte sectors that hard drives have been presenting for years.
The figure here shows what a misalignment would look like. The partition is offset from the first 512 byte sector that can be accessed on the disk. As a result all of the logical clusters above the offset partitions are now have twice as many read/write operations increasing the amount of work that needs to be done to access data and thus degrades performance. So now the hard drive has to manage two operations on two sectors instead of just managing one operation on one sector. For the new 4k drives they much do a read-modify-write operation for every write which creates a noticeable degradation in performance.
What causes this small offset creating the misalignment? All Windows operating systems versions before Vista use a 512 byte sector size to create cluster volumes. Therefore the OS starts aligning to 512b sectors and not to 4K sectors.
Due to a historical artifact of measuring on a ‘disk cylinder’ with earlier versions of DOS and Windows there were requirements for the partition to be aligned to the ‘disk cylinder’ so that addressing and accessing sectors would happen correctly. Since then OS’s use a logical block addressing scheme so there are no more ‘disk cylinders’ or ‘disk heads’ and so sectors are continuously addressed over the whole disk drive. Starting with Vista ‘cylinder alignment’ is no longer used.
By aligning all partitions this will give the system as much as 30% increase in performance. (Mileage may vary depending on the configuration)
Solid state drives (SSDs) are becoming more popular for most computing technologies. When migrating data from rotating media to SSD and flash technology make sure correct alignment is implemented to maximum optimized performance for the long term. Most SSD and flash are designed with 4k.
The life span of an SSD is limited today with the degradation of the SSD memory cells and has a limited amount of read/write cycles (around 10 million) before they become unusable. Misaligned partitions can shorten the life of the SSD with too many unnecessary read-modify-writes. Not only do you maximize the performance but you also prolong the life of the SSD device.
Important note: I am hearing that new SSDs coming out later in 2012 this 10 million writes limit for the life of the SSD goes away. The 10x price on SSDs is estimated to be more affordable about 3x in price. This is good news for the longevity and price/performance of the new SSDs.
A partition alignment tool moves partitions on the 512b sectors so that all volumes become aligned. So by moving the partition start on 2048 512b sectors from the disk start to equal 1MB will perfectly fit the 4K sectors boundaries rule.
A couple of examples of free tools available for download are:
Storage vendors are great about publishing best practices for misalignment of their technologies. Here are some to name a few:
Alignment in a virtual infrastructure is critical to performance, hardware lifecycle, and storage efficiencies. Misalignment can cause performance degradations as high as 30%, shorten the life span of SSDs and makes storage work unnecessarily harder. In the future, partition alignment issues for 4K HDD and SSD will lessen as 4K physical sectors and memory pages become visible and accessible on the operating system level, and the need for emulating becomes unnecessary. In the meantime misalignment will continue to be a performance problem and proper alignment will continue to be an essential part of performance best practices.