Azure / azure-storage-net-data-movement

Azure Storage Data Movement Library for .Net
MIT License
276 stars 132 forks source link

To download 267 MB files take 3 minutes #279

Open cpatil7 opened 3 years ago

cpatil7 commented 3 years ago

Which service(blob, file) does this issue concern?

File

Which version of the SDK was used?

2.0.4

On which platform were you using? (.Net Framework version or .Net Core version, and OS version)

.Net Core & Windows 10

How can the problem be reproduced? It'd be better if the code caused the problem can be shared.

Microsoft.Azure.Storage.File.CloudFileClient client = account.CreateCloudFileClient();

            //get File Share
            Microsoft.Azure.Storage.File.CloudFileShare cloudFileShare = client.GetShareReference("xxxxfileshare");

            //Microsoft.Azure.Storage.File.CloudFile destinationFile = 
            //get the related directory
            Microsoft.Azure.Storage.File.CloudFileDirectory rootDirectory = cloudFileShare.GetRootDirectoryReference();

            //get the file reference
            Microsoft.Azure.Storage.File.CloudFile file = rootDirectory.GetFileReference(fileName);

            //download file to local disk
            Stopwatch stopwatch2 = new Stopwatch();
            stopwatch2.Start();
            SingleTransferContext sharedTransferContext = new SingleTransferContext();
            DownloadOptions options = new DownloadOptions();
            options.DisableContentMD5Validation = true;
            await TransferManager.DownloadAsync(file, filePath, options, sharedTransferContext);

            stopwatch2.Stop();
            Console.WriteLine("Time elapsed: {0}", stopwatch2.Elapsed.TotalSeconds);

What problem was encountered?

for 267 MB file, it take ~ 3 minutes to download. Is there a way to optimize the code.

Have you found a mitigation/solution?

No