Azure Container Instances shows unexpected memory usage metrics
This article discusses scenarios in which you see lower-than-expected memory usage values in Microsoft Azure Container Instances when you check the values in the Azure portal.
Symptoms
When you check the memory usage metric of a multi-container container group in the Azure portal, the metric shows values that are lower than what you see when you run the free -h command while you're connecting to the main container.
Cause
The memory usage metric in the Azure portal displays an average value for all containers that are in the container group. It doesn't show the memory usage for only one particular container. This metric is calculated by using a default time interval of one minute. Multi-container averaging can cause the memory usage that's shown in the Azure portal to be slightly different from the usage that's shown in the output of the free
command.
Values for aggregation types (such as Average, Minimum, and Maximum) are available only as an average across all containers in the container group. These statistics aren't available for an individual container within a container group that has many containers. For more information, see Supported metrics per resource type in Azure Monitor.
Solution
You can add a dimension filter to view metrics on a per-container basis if your container group contains multiple containers. For more information, see Get metrics in the Azure portal when monitoring container resources in Azure Container Instances.
Reference
Supported metrics for Microsoft.ContainerInstance/containerGroups
Tutorial: Deploy a multi-container group using an Azure Resource Manager template
Third-party information disclaimer
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.
Contact us for help
If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.