I had a complaint from a customer today that there new virtual server with lots of resources was too slow on copying files and could I take a look.
So I did! The virtual server was connected to a 1GB switch via two different network cables. One was configured in the Hyper-V virtualization software as available for the guest and one for the host. In the host I could copy a test file across the network from a file server at close to the expected speed for the network:
Copying the same file from inside a virtual machine on that same host was considerably slower:
Notice the speeds. 85.3 MB/s compared to 355 KB/s!!!
I tried a tracert to the same file server. From the host I got 1 <1 ms <1 ms <1 ms fileserver.domain.local[192.168.1.2] but from the guest I got 1 <200 ms <201 ms <38 ms fileserver.domain.local[192.168.1.2]. Every host to file server tracert had a latency in excess of what I expect of some of the internet!
So how to fix…
On the host I checked which physical network card was being used by the Hyper-V guest (Virtual Switch Manager in the Hyper-V tools) and found it was Broadcom NetXtreme Gigabit Network #4 in this case. So in the host I brought up the properties of that same network card (Network and Sharing Center > Change adapter settings > and hover over each NIC to see the hardware description).
Bring up the properties of this network card and click Configure to bring up the configuration of the network card hardware for this specific NIC.
Change to the Advanced tab and select Virtual Machine Queues. Change this to Disabled.
Click OK. The network card will reset and come back online in about 3 to 5 seconds. The guest machine will be offline for this time as well. If you are changing the network card that the host uses as well, you will be disconnected from the host for this time as well (though you will be warned about this in the Hyper-V management tools).
Results when I connected to the guest again:
Now this is half the speed of the host – and I did not find on this machine other network settings to improve this, so I guess this is the impact of using virtualization over physical machines.