Azure / azure-storage-net

Microsoft Azure Storage Libraries for .NET
Apache License 2.0
446 stars 371 forks source link

"[C#] await blob.ExistsAsync().ConfigureAwait(false)" costs 100+s to complete #960

Open immarvin opened 4 years ago

immarvin commented 4 years ago

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

blob

Which version of the SDK was used?

11

Which platform are you using? (ex: .NET Core 2.1)

.Net Core 2.1

What problem was encountered?

this line

            BlobRequestOptions result = new BlobRequestOptions
            {
                RetryPolicy = new LinearRetry(TimeSpan.FromSeconds(1), 5),
                MaximumExecutionTime = TimeSpan.FromHours(5),
                LocationMode = Location
            };
...
bool isBlobAvailable = await blob.ExistsAsync(GetBlobRequestOptions(), null).ConfigureAwait(false);

costs 140s to complete, however, from the AZure blob Log Analytics, the end-to-end-latency-in-ms is just 5 ms, and server-latency-in-ms is 5 ms

1.0;2020-01-08T01:04:53.7662754Z;GetBlobProperties;Success;200;5;5;authenticated;seismiceast3stg;seismiceast3stg;blob;"https://seismiceast3stg.blob.core.windows.net/stepstone/t29092eb1-d95f-4b92-9e61-5c9064017a88";"/seismiceast3stg/stepstone/t29092eb1-d95f-4b92-9e61-5c9064017a88";85b47b28-a01e-00fd-3fbf-c52e9a000000;0;13.91.33.77:17152;2019-02-02;645;0;1210;0;0;;;""0x8D793D639FCD966"";Wednesday, 08-Jan-20 01:01:00 GMT;;"Azure-Storage/11.0.0 (.NET Core; Unix 4.15.0.1037)";;"77999836-58a9-4b97-afef-a40cdae48acb"

How can we reproduce the problem in the simplest way?

NA

Have you found a mitigation/solution?

NO

vnguyenau commented 4 years ago

I have absolutely same issue every hours. Sometimes it took few mins. In the Storage log show few milliseconds but app insights show few mins. I try async and non-async both same issue. Even with Upload method. Only one thing I may do differently is I make a loop to check the exist of 6 blobs at the same time. I am using NET core 3.1. Please investigate.

vadim-kor commented 4 years ago

Can it be related to Nagle Algorithm? Try to set it "false" https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager.usenaglealgorithm?view=netcore-3.1