Friday 15 January 2016

Slow down a network file copy

I've recently been virtualising our servers at work and I completed a P2V of our main server. This has been the most difficult to do because it previously hosted all of the network services, so it's been difficult to take offline and separate out the roles onto virtual machines without causing too much disruption. Anyway I was down to the last step, which was to virtualise the remaining database server but it generated a massive 400GB VM to copy onto the Hyper-V host.

I kicked off the copy from the physical server to it's new home and thought nothing of it, until one of my colleagues sitting next to me started to complain that database access had really slowed down. I checked task manager and discovered that the copy process had consumed 100% of the network bandwidth on the server. I quickly cancelled the copy and everyone in the building thanked me for working my magic and getting things working again!

I decided that if I wanted to complete this transfer and get started setting up the new VM I needed to find a way to copy the VHD file without using up all of the bandwidth on the server. Fortunately it only took a short amount of Google searching to find what I was looking for. The really handy Robocopy program built into Windows has an option called inter-packet gap that allows you to specify a copy speed when copying across the network. In my case I reduced the copy speed to only 25% of the network card bandwidth and although it took longer it copied successfully without interfering with the network based services on the server.

You can find out all about the options for Robocopy (including the wonderful inter-packet gap) here.

No comments:

Post a Comment