Hardware performance penalty for Hyper-V Generation 2 VMs

hyper-vperformancessdwindows-server-2012-r2

I have the following configuration:

  • Windows Server 2012 R2 OS installed on baremetal with Hyper-V. OS is
    installed on RAID1 850 PRO drives.
  • Windows Server 2012 R2 Guest OS Generation 2 VM is located on Windows Storage Space Mirrored 950 PRO drives.

I ran some tests on the Windows Storage Space Mirrored 950 PRO drives using
Crystal Disk. These are the following stats.

When tested on baremetal

   Sequential Read (Q= 32,T= 1) :  4178.159 MB/s
  Sequential Write (Q= 32,T= 1) :  1504.286 MB/s
  Random Read 4KiB (Q= 32,T= 1) :   460.155 MB/s [112342.5 IOPS]
 Random Write 4KiB (Q= 32,T= 1) :   266.983 MB/s [ 65181.4 IOPS]
         Sequential Read (T= 1) :  2042.397 MB/s
        Sequential Write (T= 1) :  1500.305 MB/s
   Random Read 4KiB (Q= 1,T= 1) :    40.059 MB/s [  9780.0 IOPS]
  Random Write 4KiB (Q= 1,T= 1) :    76.623 MB/s [ 18706.8 IOPS]

When tested in VM

   Sequential Read (Q= 32,T= 1) :  4635.549 MB/s
  Sequential Write (Q= 32,T= 1) :  1502.071 MB/s
  Random Read 4KiB (Q= 32,T= 1) :   181.225 MB/s [ 44244.4 IOPS]
 Random Write 4KiB (Q= 32,T= 1) :   110.272 MB/s [ 26921.9 IOPS]
         Sequential Read (T= 1) :  1624.129 MB/s
        Sequential Write (T= 1) :  1381.203 MB/s
   Random Read 4KiB (Q= 1,T= 1) :    24.528 MB/s [  5988.3 IOPS]
  Random Write 4KiB (Q= 1,T= 1) :    34.563 MB/s [  8438.2 IOPS]

I have nearly a 50% drop in performance on my Random Read/Writes. I retested a couple times to confirm values. Is this to be expected?

Best Answer

First of all it's a good idea to use DiskSPD rather than anything else. Just because Microsoft uses DiskSPD during their internal QA process.

https://blogs.technet.microsoft.com/josebda/2014/10/13/diskspd-powershell-and-storage-performance-measuring-iops-throughput-and-latency-for-both-local-disks-and-smb-file-shares/

Second this is known issue with Hyper-V. It's even present in more or less the same way in Windows Server 2016. In a nutshell there's typically a 2x - 4x I/O performance drop if your underlying storage has very low latency. You can try a couple of workarounds to improve your conditions:

Use multiple volumes. Don't allocate multiple CSVs on top of a single virtual disk or namespace but rather make sure local mount points (if you run VMs right from DAS), CSVs or SMB3 shares end on top of a different logical volumes! You'll have to have a single VM with multiple VHD files or multiple VMs to "aggregate" combined performance this way. If you have one VM with a single attached VHD this approach won't help obviously.

Use "middle man". This is sort of an incremental improvement within the first approach listed. You get multiple logical volumes, wrap some Windows-based software-defined storage on top and allow it to aggregate I/O performance for your single VM with a single VHD attached. It can happen if you run single Oracle RAC or SQL Server VM and it's exactly the one you want high IOPS for.

Disable I/O scheduler. Set registry key ...

"HKLM\SYSTEM\CurrentControlSet\Control\StorVSP\IOBalance\Enabled"

... to zero! P.S. Don't forget to reboot as nothing changes on-the-fly.

This one may or may not work. We get ±20% boost on a pair of Samsung 850 Pro SSDs in RAID0.

Hope something is going to work for you. Please update with your results for future lurkers :)