E-MapReduce (EMR) provides the cost analysis feature for task node groups that contain pay-as-you-go or preemptible instances. You can view the resource usage and cost allocation from multiple dimensions. This helps you evaluate the cost-saving effects of auto scaling and optimize the resource usage of your cluster. This topic describes how to view the auto scaling cost dashboard in the EMR console.
Prerequisites
The AliyunEMRManagedCostRole role is assigned to EMR as prompted in the console.
You must assign the role to EMR by using an Alibaba Cloud account or a RAM user when you use the cost analysis feature for the first time.
A task node group that contains pay-as-you-go or preemptible instances is added in the cluster. For more information, see Add auto scaling rules.
Precautions
The cost data is displayed on the dashboard with a delay of one day. The cost data of the previous day is calculated at 06:00 every day.
The costs of a single node group are estimated values and may be different from the actual fees in the final bills. The actual costs of the cluster in the final bills prevail.
The costs of the node groups that use saving plans cannot be analyzed.
Procedure
Go to the Auto Scaling tab.
Log on to the EMR console. In the left-side navigation pane, click EMR on ECS.
In the top navigation bar, select the region in which your cluster resides and select a resource group based on your business requirements.
On the EMR on ECS page, find the desired cluster and click the name of the cluster in the Cluster ID/Name column.
On the page that appears, click the Auto Scaling tab.
Click the Auto Scaling Cost Analysis subtab.
On the subtab, you can view the auto scaling cost dashboard.
Parameter and metric
Description
PretaxGrossAmount/PretaxAmount
The type of the cost data that you want to view.
PretaxAmount: displays the fees of all the resources in the cluster after discount. By default, PretaxAmount is selected.
PretaxGrossAmount: displays the original fees of all the resources in the cluster calculated based on the catalog prices.
For more information about the actual fees after discount and the fees calculated based on the catalog prices, see Billing details.
NodeGroup
The task node group whose allocated cost you want to view. By default, All is selected.
NoteOnly the task node groups that contain pay-as-you-go or preemptible instances are supported. Only the task node groups that have cost data are available.
Select Time
The time range of the data displayed in the dashboard. The default time range is the last 7 days. You can specify a time range to view the changes in costs and resources within the specified time period.
Cost for yesterday
The costs of elastic resources in this cluster.
The cost data is calculated on the next day. Therefore, the cost data of the current week is unavailable on Monday, and the cost data of the current month is unavailable on the first day of the month.
The day-over-day growth rate compares the cluster cost of the previous day and the cluster cost of the day before the previous day.
Cost for this week (calendar week)
Cost for this month (calendar month)
The day-over-day growth rate
Cost
The cost trend.
Cpu-All
The changes in the total number of the cores of elastic nodes. Generally, the changes are correlated with the cost trend. If the changes in the total number of the cores of elastic nodes are inconsistent with the cost trend, the unit cost of the cores is abnormal in the specified time period. You need to check whether resources that are more expensive are used.
Cost of each nodeGroup
The allocated cost of each task node group.
Estimated cost savings if all nodes are spot instance
The estimated cost savings based on changes to the billing method of the nodes. This metric helps you analyze the cost savings if you change all the elastic nodes to preemptible instances. This way, you can optimize the resource usage of your clusters and the billing methods of elastic nodes.