Check your VM’s alignment for Better Performance

Check your VM’s alignment for Better Performance

The Partition alignment process is not a new concept and has existed in the industry for years for Windows and Linux system way before the introduction of server virtualization.

The problem is that by default, some Operating Systems, including versions of Windows (Windows 2000, Windows 2003) and Linux align the first sector on a full disk track boundary. But now windows 2008 comes with this issue fixed J

When setup routine queries the CHS (Cylinder / Head / Sector) information of the disk from the BIOS, the CHS data doesn't actually corresponded to anything physical. At large LUN sizes, the S number (sectors per track) is always reported as 63, so partitioning is set at 63 sectors starting offset.

The problem is that 63 sectors, corresponds to 32256 bytes or 31.5KB, which does not align with storage array's logical block size. Physical disk blocks always correspond to 512 bytes in size, but for efficiency and performance reasons, disk arrays use a logical block size unit that is a multiple of the physical block size.

In a properly setup environment (physical or virtual) the host should align its partitions in such a way that writes/reads are aligned to the array's logical block size. That would mean that you'd have a 1:1 ratio of logical to physical reads/writes. In any other case, you'd be forced to read/write potentially up to twice as many blocks as the application actually requested, since any File system block actually occupies at least two partial physical blocks.

The end result of this from a performance as well as a sizing perspective can be significant since you can be doing up to 2x the number of IOs and thus you may require up to 2x more spindles to support the number of IOPs. Furthermore, in an undersized environment where this is happening you will see a sharp increase in latency and when folks complain about performance, it's latency they typically complain about.

mbralign - This is a tool the provides you with the ability to align a GuestOS's partitions in 4 steps:

1) Shut down the VM

2) Run mbralign

3) Power on the VM

4) Remove the backup files

Prior to going thru the process, the tool, makes a backup of the .vmdk and *-flat.vmdk files and creates a new file .vmdk and properly aligned *-flat.vmdk and copies the data from the old source vmdk to the new destination vmdk. After the process is done you have to manually clean up the two backup files created initially.

What type of performance can be expected while running this tool?

There are many factors which gets involved you are running this tool.

  • The size if the file

  • Load on ESX host (because you run this tool through console on the ESX where VM is registered)

  • The Load on Controller

  • The IP network Traffic till the time vmdk is fully aligned ( I am talking about network traffic because I am taking about NFS which is using TCP/IP protocol )

Please let me know if anyone else is seeing performance issue specially on using NFS protocol.

- VMKillies

Comments

Hi!

Where can we get "mbralign"?

Hi,

Mbr Allignment tool is from NetApp, if you are a netapp customer you can get the tool downloaded from there website.

Any possibility without being a netapp customer? Smiley Wink

It works for all the VM's irrespective of the storage in the background.

It basically alligns your first data byte on Mbr so the read and write becomes sequential.

Also check the server before you delete the backed-up vmdk's , i get stuck couple of time when i had to go back to old vmdk's for un-explained reasons Smiley Happy

Version history
Revision #:
1 of 1
Last update:
‎08-21-2009 11:15 AM
Updated by: