Does SQLIO lie when run from a Hyper-V guest on a VHD

hyper-vsqliostoragevhd

SQLIO seems like a useful tool. I thought it would be interesting to try to measure the speed difference between a physical disk and a VHD. So I ran SQLIO on the Hyper-V host on the physical drive. Results seemed reasonable. Then I ran it from the guest to test the vhd (on the same physical disk). I expected it to be a bit slower. But instead it was way faster – like 0ms average latency.

So I'm trying to learn something here. It seems like hyper-v is fooling SQLIO somehow but I don't understand it well enough to figure it out.

It's a dynamic vhd, no snapshots or anything, and the vhd is the only file on the disk. The physical disk is actually a two SAS drive RAID 1.

Best Answer

I know I'm late to the party here but I've found that using SQLIO on Dynamic disks does give false results. The reason behind this is that the tesfile.dat is just a zeroed out file, so the dynamic disk is clever enough to compress this file down behind the scenes, which in turn means it'll fit in your disk cache. So your SQLIO test is essentially just testing how fast your cache is.

I'm sure this is well resolved, but I had trouble finding the answer when I was testing, so I thought it might be useful to write it down for future reference :)

Stephen