Skip to content

Latest commit

 

History

History
61 lines (31 loc) · 3.77 KB

File metadata and controls

61 lines (31 loc) · 3.77 KB

Autoscaling Cloud Native Apps on Azure: Overview

Key Takeaways

In this demo, you'll get an overview of the autoscaling features of various Azure services like ACA (Azure Container Apps) and AKS (Azure Kubernetes Service).

You'll also get an insight into how to use Azure Monitor to monitor the application's performance and health.

All these are especially crucial for an e-commerce application like Contoso Traders, which is expected to instantly handle a large, sudden spike in number of users, with low latency and no downtime.

Before You Begin

  • There are some prerequisites for this demo mentioned in the application deployment guide. After executing all the steps mentioned in that document, the application's infrastructure will be provisioned on Azure, and the latest code will be deployed as well.

Walkthrough: Metrics & Dashboards

  1. In the Azure portal, you can navigate to the Azure Container App in the contoso-traders-rg resource group.

    ACA

  2. For demo purposes, we have configured a HTTP Scaling rule that horizontally scales out additional replicas when the number of concurrent requests exceeds a threshold (3 in this case). ACA also supports automatic scale-in to zero when traffic dips below threshold.

    ACA Scaling Rules

  3. In the metrics tab, you can see the various metrics measured & published by the ACA infrastructure. You can create a metric chart that combines two metrics: replica count vs requests. This will help you visualize the increase in replica count under load.

    ACA Metrics Chart

  4. Finally, you can pin this metric chart to the dashboard for easy access. This dashboard can be a shared-team dashboard, or a private dashboard.

    ACA Metrics Chart Pinning

Walkthrough: Load Testing & Autoscaling

  1. We have a GitHub workflow that executes load tests on the application's APIs. The workflow can be launched on-demand from the GitHub Actions tab of this repository.

    github workflow

  2. The workflow uses a github action to invoke the Azure Load Testing service and simulates load on the application's Product API and Carts API, which are hosted on AKS and ACA respectively.

    workflow for load testing

    github action for load testing

  3. The load test takes about 2 minutes to execute. Once done, you can navigate to the Azure Portal to get more in-depth details about the test.

    load testing result

    load testing portal

  4. You can also direct the load testing service to extract & correlate metrics from the concerned Azure Services. This will give you a great overview of how the various APIs/databases performed under load, whether the users got throttled/rate-limited, whether the average round-trip latency increased etc. In the example below, it has correlated metrics from Azure CosmosDB (which is used by Carts API).

    load testing cosmos

  5. You can also revisit the earlier metric charts in ACA. It'll now have updated with the latest data after the load test. Of particular interest is the replica count chart of Carts API, which shows the instances auto-scaled out under increasing load. After load subsided, the instances auto-scaled back in to zero.

    load testing ACA

Summary

In this demo, you got an overview of the autoscaling features of Azure services like ACA (Azure Container Apps). You can now head over to a detailed demo of AKS autoscaling.