1

We use an Azure BlobStorage account prod-example (Performance/Access tier: Standard/Hot), and via it's Azure CDN prod-cdn-example-blob endpoint (General web delivery) images are served to an App Service.

Occasionally, in Application Insights of the App Service, I read dependency failures when fetching these images, and the failed requests always have a duration of approximately 1.0 s. Something like this:

Event time 1/8/2021, 12:20:39 AM (Local time)
Dependency type HTTP
Dependency call status false
Dependency duration 1.0 s
Remote dependency name HEAD /cache/4/f/8/a/0/5/4f8a05d3ec4f2b564eb9ce02e77b39d8f2d5f04b.png
Telemetry type dependency
Operation Id 2ec9b5cb70173b43bf70212635495218
Parent Id |2ec9b5cb70173b43bf70212635495218.ddfc26a7_
Device type PC
Client IP address 0.0.0.0 City city
State or province province
Country or region country Cloud role name instance-name
Cloud role instance instance-number
SDK version rdddsd:2.9.0-23612
Sample rate 1
Dependency Id |2ec9b5cb70173b43bf70212635495218.ddfc26a7_3.
Performance 1sec-3sec
Base name prod-cdn-example-blob.azureedge.net

This specific image is 21.76 KiB, so a large image should be excluded. When looking into the logs, I've seen that only requests with dependency duration of 1000 ms or above fail (in fact, 95% of all failures had aproximate duration of 1000 ms). Additionally, I've checked that certain images that failed once, had a successful dependency call on 20 other occasions, so it shouldn't be related to specific images. So, in one occasion, the request takes cca 1000 ms, while on all the other occasions it takes 10 - 20 ms.

Two days ago, there was a sudden increase in these failures (150 total cases for that day). After I purged the CDN cache, the problems stopped. After an hour, the occasional failures returned (totaling to cca 40 cases per day).

I hope I've provided the right/necessary information.

What may be causing this issue? Is there any way I can tweak this timeout rule, and where? Are there any other ideas as to what I can analyze to see why some requests take so long?

EDIT: Additional information: in an instance where I was able to personally recreate the issue of not loading images on the web app, I got the 504 response for the image item in the Response Header in browser.

Armino
  • 129
  • 1
  • 1
  • 11
  • 1
    According to your description 'purged the cdn cach, the problems stopped', so have you tried to change the caching rules to set a shorter expiration duration? – Tiny Wang Jan 15 '21 at 08:21
  • There are currently no caching rules set on this CDN. Also, I don't see a "cache-control" information in the response header in the browser on the image item. Do you know of a way to check the default cache rule TTL that's applied in case no cache rules are set? I can't find anything about this. Perhaps I can simple add any number of days as a cache rule and see how it behaves... – Armino Jan 15 '21 at 09:07
  • I add a screenshot as the answer, I mean that you may set your own cache rules to override the default rule. – Tiny Wang Jan 15 '21 at 09:17
  • Thank you, I don't know how I didn't see that the "7 days" info right there, I apologize. I will try to override this with my own rule. – Armino Jan 15 '21 at 09:25
  • Yes, just try it, hope it would be proved to make sense. – Tiny Wang Jan 15 '21 at 09:30
  • Have you got any progress? – Tiny Wang Jan 19 '21 at 09:17
  • I am currently still monitoring. I actually first increased the TTL to 30 days (just to see what happens). So for, nothing changed - the daily average of dependency failures is still the same. I will reduce the TTL tomorrow to half-a-day, then we will see what happens. – Armino Jan 20 '21 at 13:07
  • Ok, let's wait for it. – Tiny Wang Jan 20 '21 at 13:21

1 Answers1

0

I created a new endpoint and the cache rule is like below, just take a try: enter image description here

Document about set cache rule.

Tiny Wang
  • 10,423
  • 1
  • 11
  • 29