azure-sdk-for-net: [QUERY] ShareFileClient.StartCopyAsync extremely slow

Library name and version

Azure.Storage.Files.Shares 12.12.1

Query/Question

We’re struggling with massive slowness of simple copy operations between storage accounts. We store files in blobs and copy them to file shares upon request from the application, and this operation is far too slow to be feasible for on-demand access.

Doing a simple azcopy copy can see the operation done in hundreds of milliseconds, but utilising StartCopyAsync, then polling GetPropertiesAsync to monitor when CopyStatus moves to CopyStatus.Success can see the process take up to minutes for files just >50 MB.

What can we do to optimise this interaction? The application is running in Azure on Kubernetes in the same region.

Environment

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

So the reason why there’s a speed difference is because you’re using a different REST API.

StartCopyAsync(https://learn.microsoft.com/en-us/dotnet/api/azure.storage.files.shares.sharefileclient.startcopyasync?view=azure-dotnet) is using the Copy File REST API.

While the default copy Blob to Share File AzCopy command is using the Put Range From URL which in the .NET SDK is UploadRangeFromUriAsync.

While we cannot guarantee matching performance between Azcopy and the SDK as they are two different products, I believe you can get closer to your expected performance if you used the UploadRangeFromUriAsync API instead.