Azure Front Door generates a large amount of bandwidth
Asked Answered
A

2

9

Last month I noticed a large increase of my Azure bill due to outgoing bandwidth. I used 1800GB of outgoing data vs ~200GB in previous periods. After some research I found that this was caused by the Azure Front Door service that I enabled last month and I was not aware of the additional indirect costs associated with the service.

I'll provide my analysis of the "issue" below to hopefully perevent others from making the mistake I made.

Asthenosphere answered 8/4, 2019 at 11:56 Comment(1)
In addition to frequent visits, outgoing bandwidth rates are pretty high too like 20 cents per gig. Compare that to the pricing here: azure.microsoft.com/en-us/pricing/details/bandwidth. Azure sucks for not providing a better solution.Ketubim
A
12

Azure Front Door allows for quick failover between groups (so called "pools") of web applications based on the health of the applications in the pool. A typical failover scenario would be between different regions. If one region has an issue, you failover to the other region.

The mechanism by which Front Door determines the health of an application is by sending a HTTP request where a 200 OK result is considered healthy.

The moment you enable Azure Front Door on your backend, it starts checking the health of your backend application and you potentially start paying so I performed some analysis and these are my findings:

Azure Front Door Requests and Bandwidth [Range 4 hours, granularity 1 minute]

  1. 08:05 Started the webapp.

  2. 08:30 Enabled Front Door Service with default settings (Interval=30sec, Sample size=4, Successful samples required=2). Notice the immediate growth in number of requests from 0 to ~140 per minute.

  3. 09:03 Decreased the health probe interval from 30sec to 15sec. Notice the immediate growth in requests.

  4. 09:40 Quadrupled the body size of the health probe endpoint from 30KB to 119KB. Notice the immediate growth in bandwidth.

  5. 09:55 Reduced the body size of the health probe endpoint to 0KB. Notice the immediate drop in bandwidth.

  6. 10:08 Increased the health probe interval from 15sec to 90sec. Notice the immediate drop in requests.

It seems like the bandwidth is charged as outgoing bandwidth of the App Service (or whatever endpoint service is used) on top of the bandwidth of the Front Door service. I think this is because the Azure Front Door is a global service and therefore not region bound. These "hidden" charges are not mentioned on the pricing page

This default landing page of an Azure Function App is 126KB: enter image description here

Takeaways

  1. By default, Azure Front Door seems to visit your endpoint 140 times per minute and generates 20MB of traffic per minute (with a 30KB body). That is 27GB, or, EUR 1,90 per day (EU/US regions).

  2. Don't use the default function app landing page as your health probe endpoint (or any large home page). I'm not sure about the best practices but I would think a custom endpoint that actually does some health checking and returns an empty body would be best.

  3. Choose your interval wisely. Double the interval = double the bandwidth costs.

Asthenosphere answered 8/4, 2019 at 11:56 Comment(4)
This is good info but... it doesn’t really fit here, as it’s not a programming question. This would probably work better as a blog post (or augmentation of the official docs if you feel this isn’t already covered there).Rosado
You are right, this should be added to the Azure pricing page / docs so I submitted it as feedback to Microsoft. I do believe that SO is a good place for this kind of info too. I see it as building a knowledge base which is explicitly encouraged and as an answer to the question "Why is Azure Front Door generating so much traffic?"Asthenosphere
Thanks so much for posting this! If interval = 30s, I would expect 2 requests per minute. But instead I am seeing close to 200 requests per minute i.e. 100 times more! You are suggesting this is because they are multiple front door endpoints around the globe, and each one is doing a probe every 30 seconds. That makes sense. For people landing here in future, this link should be helpful to track progress.Adverbial
I have to agree with previous poster - VERY much thank you for your details and analysis! Saved me a lot of time. It seems front door is still quite new and it's not super clear exactly what it's doing all the time (for example, there are no ways I know of to check each health probe somewhere in Azure portal).Cartogram
D
2

Set AzureWebJobsDisableHomepage to true in your app service config to remove the landing page from /, this saves on response size which saves on egress cost.

Dull answered 4/1, 2023 at 13:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.