This topic describes how to view the billing details of MaxCompute.

Billing Management

Log on to the Alibaba Cloud console. In the top navigation bar, click Billing.
Note If you log on to the console as a RAM user, you must obtain the AliyunBSSFullAccess permission before you can use the console properly. For more information, see Grant permissions to a RAM role.

Billing details

  • Querying daily bills
    1. On the Bills page, click the Bills tab.
    2. Select MaxCompute from the Product Name drop-down list to view the daily bills of MaxCompute.
      The Product Detail column is described as follows:
      • MaxCompute (Postpay) with Subscription Type set to Pay-As-You-Go: all pay-as-you-go bills generated for storage, computation, and Internet download traffic on the day after pay-as-you-go billing is enabled under the account.
      • Maxcompute (Prepay) with Subscription Type set to Pay-As-You-Go: all pay-as-you-go bills generated for storage and Internet download traffic on the day after subscription billing is enabled under the account.
      • Maxcompute (Prepay) with Subscription Type set to Subscription: all subscription bills generated for new purchases, configuration upgrade and downgrade, and renewal on the day under the account.
  • Querying daily consumption details of pay-as-you-go billing items
    1. On the Bills page, click the Details tab.
    2. Set Statistic Item to Billing Item, Statistic Period to By Day, and Subscription Type to Pay-As-You-Go.
    3. Select MaxCompute from the Product Name drop-down list to view the daily bills of each billing item.
      Information in the preceding figure is described as follows:
      • Instance ID: corresponds to a MaxCompute project. Bills in pay-as-you-go mode are generated by project. A bill is generated for each billing item each day.
      • Billing Item: includes storage, computation, and Internet download traffic.
      • Usage: The usage of each billing item is described as follows:
        • Storage: storage space used for the project on the day divided by 24
        • Internet download traffic: total data downloaded over the Internet for the project on the day
        • SQL task computing: total data input size of SQL standard tasks that were successfully executed for the project on the day multiplied by SQL complexity
        • SQL external table computing: total data input size of SQL tasks that were successfully executed for calculating external tables for the project on the day
        • Developer SQL task computing: total data input size of SQL tasks that were successfully executed for the project (using developer resources) on the day
        • MapReduce task computing: computation hours used to complete MapReduce tasks for the project on the day
        • Interactive analysis task computing: total data input size of interactive analysis tasks (Lightning) that were successfully executed for the project on the day
        • Spark task computing: computation hours used to complete Spark tasks that were successfully executed for the project on the day

You can set Statistic Item and Statistic Period to different values to view billing details from different dimensions. You can also click Export Billing Overview (CSV) in the upper-right corner to download the bills to your computer and analyze the bills in an Excel file. However, the billing details do not provide the consumption amount of a single task. To view the consumption amount of a single task, download Usage Records to obtain the original metering information for calculating the consumption amount of a single task.

Usage records

Downloading usage records

Choose Computing pricing to view daily resource usage and how fees are calculated, specifically, the storage fee each day and which tasks generated the fee.

Set parameters in the Usage Records dialog box:
  • Product: Select MaxCompute (Pay-As-You-Go).
  • Billing Method:
    • MaxCompute(Postpay): indicates the pay-as-you-go billing method.
    • ODPSDataPlus: indicates the subscription billing method.
  • Time Period: You can specify the start time and end time of the bills you want to view.

    If a task spans two days, for example, a task starts on December 1 and ends on December 2, you must set December 1 as the start time. Otherwise, you cannot find the task in the downloaded usage records. However, the consumption record can only be found in the bill of December 2.

Using usage records

After you export usage records to your computer as a CSV file, open the file to view detailed information.
The CSV file includes the following table headers:
ProjectId, MeteringId, MeteringType, Storage, EndTime, SQLInput(Byte), SQLComplexity, UploadEx, DownloadEx(Byte), MRCompute(Core*Second), InputOTS(Byte), InputOSS(Byte), StartTime, SpecificationType, DataWorksNodeID
The usage records allow you to:
  • View the InstanceID of each SQL or MapReduce task and run the following command to view details about the task, as shown in the following example:
    odps@ odps_test>desc instance 2016070102275442go3xxxxxx;
    ID 2016070102275442go3xxxxxx
    Owner ALIYUN$***@aliyun-inner.com
    StartTime 2016-07-01 10:27:54 
    EndTime 2016-07-01 10:28:16
    Status Terminated 
    console_query_task_1467340078684 Success 
    Query select count(*) from src where ds='20160628';
    Note You can also view the execution information of a specific task by checking the TASKS_HISTORY and TUNNELS_HISTORY views of the MaxCompute Inforamtion_Schema service. However, the views only provide task execution information for the last 15 days.
  • View the original metering information of each SQL or MapReduce task and calculate the fees of the task by using the formula provided in the pricing document. For example:
    • Calculating the costs of an SQL standard task. ComputationSql in the MeteringType column indicates an SQL standard task. The formula for calculating the computing costs of an SQL standard task is as follows: Data input size (GB) × SQL complexity × SQL unit price.
    • Calculating the costs of computing external tables, such as external OTS and OSS tables. Use the value of InputOTS(Byte) or InputOSS(Byte) in the CSV file as the data input size of the external table task. The computation costs of an external table are calculated as follows: Data input size × SQL complexity × SQL price.

      SQL price is USD 0.0044/GB/complexity. For SQL tasks, one unit of complexity is applied.

    • Calculating the costs of a MapReduce task. Query the resource and time consumed by the MapReduce computing task in the MRCompute(Core*Second) column.

Bill analysis in typical scenarios

  • Are my data uploads and downloads billed?
    You can check charges generated from data uploads and downloads by completing the following steps:
    1. Export usage records as a CSV file, and analyze the billing details for data downloads. DownloadEx indicates the Internet download billing item.
    2. In the case that you find a record for a download fee of 0.036 GB (which is equal to 38,199,736 bytes), you can calculate the charges according to Download pricing(Pay-As-You-Go): (38,199,736 bytes/1024/1024/1024) × USD 0.1166/GB = USD 0.004.

    3. Optimize data downloads.

      You can also check whether the service that is configured for your tunnel is billed due to Internet access. For more information, see Configure endpoints.

      For example, if you are located in China (Su Zhou) and you select the China (Shanghai) region, you can download data to your VM through an ECS instance in the China (Shanghai) region, and then use your subscription ECS instance to download the data.

  • How is storage of less than one day billed?
    1. Export usage records as a CSV file, and analyze the billing details for storage.
    2. View Storage in the MeteringType column. A total of 333,507,833,900 bytes of data is stored for the alian project. The data was uploaded at 8:00. Therefore, storage was billed from 9:07 and a total of 15 hours are charged for storage.
      Note If the billing cycle is one day, the billing stops at the end of each day. Therefore, the last record is not included in the bill of that day.
      The average storage over the last 24 hours is calculated based on Storage pricing (pay-as-you-go).
      --Calculating the average storage
      333507833900 bytes × 15/1024/1024/1024/24 = 194.127109076362103 GB
      
      --The data size is 194 GB. The storage unit price for the range "greater than 1 GB and less than 100 GB" is USD 0.0028/GB/day. The storage unit price for the range "greater than 100 GB and less than 1 TB" is USD 0.0014/GB/day. Therefore, the storage fee per day is calculated as follows with four decimal places:
      100 GB × USD 0.0028/GB/day + (194.127109076362103 GB - 100 GB) × USD 0.0014/GB/day = USD 0.4118/day
  • The fee surge is beyond my expectations.
    If your fee surges in one or a few days but the increase is not caused by business growth, perform a preliminary analysis:
    1. Analyze projects that generate high charges. Choose Bills > Details, set Statistic Item to Instance, set Statistic Period to By Day to determine the projects (Instance ID) that generate high charges. If the consumption amount of a project is not as expected, analyze the project.
    2. Analyze the billing items that generate high charges. Choose Bills > Details, set Statistic Item to Billing Item, set Statistic Period to By Day to determine the billing items that generate high charges. You can search for a specific project based on Instance ID and then analyze its billing items that generate high charges.
    3. Analyze computing tasks that generate high charges. Download Usage Records to analyze computing tasks that generate high charges. Then view detailed execution information based on the MeteringId (InstanceId) of the task.