In my blog post Super Cheap Azure Web Site using Azure CDN, I have written about setting up a very cost-effective approach of serving up an Azure Web App using Azure CDN as a form of proxy.
Scenario
- Load test Azure Web App in free tier using Azure CDN S1 tier.
Azure CDN endpoint
A content delivery network (CDN) is a distributed network of servers that can efficiently deliver web content to users. CDNs store cached content on edge servers that are close to end-users, to minimize latency.
Pricing Tier
I have selected the Standard Verizon tier over the premium, since it offers easier caching configuration rules in the Azure Portal.
Caching Rule
I have set a very simple caching rule in the CDN with expiry of 1 day for all requests. Typically you would have a more fine-grained caching strategy that varies by content (e.g. images, css, js, video, html, etc.) and cache duration. For further details read Control Azure Content Delivery Network caching behavior with caching rules
Custom domain and HTTPS
Since I have chosen Azure Web App Free tier, it doesn’t offer custom domain and https support, and so I leverage these features at the CDN endpoint. For details read Add a custom domain to your CDN endpoint and Configure HTTPS on an Azure Content Delivery Network custom domain
Azure App Service Plan
F1 Free Tier
The free tier sets a quota for the web app at 60 minutes of CPU time per day. When this is exhausted, the web app becomes in stopped state until the next day. Therefore, if you believe your traffic is low enough even with the CDN’s caching and can absorb the risk of the web app being stopped, then this may be an option. For detailed quota information read Quota Information for App Service limits
The CPU time is The amount of CPU in seconds consumed by the app. For details read Understanding Quotas and Metrics
Visual Studio Load Test
IE recorded set of URLs to simulate a web test scenario.
The load test executes the webtest many times with every simulated user with the following load step pattern over at 15-minute duration test. The load pattern starts with 100 virtual users and increases by 50 every 10 seconds bounded by 1000 user count.
Execution Results
Overall, an immense number of requests with sub second avg. page response time.
Azure Web App Metrics
During the load test, the CPU Time and the number of requests start off very little and decreases mostly for the rest of the load test. This would indicate that the Azure CDN would respond to the user’s browser with cached content from the CDN. Thereby limiting very little traffic to the Azure web app.
For the web app’s quota, the free tier has a max quota of 60 mins per day of CPU time. During the load test, about 0.20 minutes of CPU time was consumed. In contrast, when I did the same load test directly against the web app rather than the CDN endpoint, the 60 minutes quota was quickly consumed.
Conclusion
I have shown an Azure CDN endpoint serving requests of cached content so that traffic is offloaded from the originating Azure Web App. This is so that it provides the option to select the Free tier pricing plan to make for a very inexpensive hosting solution.