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.
- 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.
-
In the Azure portal, you can navigate to the Azure Container App in the
contoso-traders-rg
resource group. -
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. -
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
vsrequests
. This will help you visualize the increase in replica count under load. -
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.
-
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.
-
The workflow uses a github action to invoke the Azure Load Testing service and simulates load on the application's
Product API
andCarts API
, which are hosted on AKS and ACA respectively. -
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.
-
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).
-
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.
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.