Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save sdoubleday/470cbcdfc0c32977858c512dc585e841 to your computer and use it in GitHub Desktop.

Select an option

Save sdoubleday/470cbcdfc0c32977858c512dc585e841 to your computer and use it in GitHub Desktop.
Throttling AzCopy Upload Speeds with Quality of Service policies in windows using PowerShell.

<#When populating Azure data stores, sometimes I find it is simplest to copy a great deal of data over the network, but I do not have authorization to monopolize the outbound pipe. In those cases, I copy data with AzCopy.exe on one server, and I throttle those copy jobs by setting up a Quality of Service policy on that server. This solution relies on running all copy jobs through the server that has this policy enabled. It should throttle multiple parallel copy jobs to the TOTAL ThrottleRateActionBitsPerSecond you specify. ActiveStore means this does NOT persit after reboots. Pick a rate that is appropriate to your environment.

Remember that when setting up QOS policies, you need to throttle the thing DOING the copying, not the thing INVOKING the thing doing the copying. I.e., if you run your azcopy.exe job in PowerShell, don't throttle PowerShell, throttle azcopy.exe#>

New-NetQosPolicy -Name throttleAzCopy -PolicyStore ActiveStore -AppPathNameMatchCondition azcopy.exe -ThrottleRateActionBitsPerSecond 25MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment