This topic describes how to view the billing details of MaxCompute and how to estimate SQL-related fees.

Instance billing details

The following two billing methods are available:

  • Pay-As-You-Go: Costs are calculated according to the actual job size.
  • Subscription: Costs are estimated and the relevant usage allocation is paid for in advance.
Note MaxCompute supports the following computing task types: SQL and MapReduce. Storage and data downloads support only the Pay-As-You-Go billing method.
You can view your instance billing details by time, as shown in the following figure.

Note If the Pay-As-You-Go billing method is used, storage and data downloads are billed in addition to your subscription fee.
You can click Details to view the billing details of each project. You can also choose Usage Records from the left-side navigation pane to see how billing is calculated.

Usage records



After you export your usage records as a CSV file to your computer, open the file to view the metering information and InstanceID of each SQL or MapReduce task. An example is as follows:
ProjectId, MeteringId, Type, Storage, ComputationSqlInput, ComputationSqlComplexity, UploadEx, DownloadEx, CUUsage, StartTime, EndTime
odps_test,2016070102275442go3xxxxxx,ComputationSql,,4638334,1,,,,2016-07-01 10:28:06,2016-07-01 10:28:11odps_test,20160701023045523guanpxxxx,ComputationSql,,4638334,1,,,,2016-07-01 10:30:56,2016-07-01 10:31:01odps_test,1706596874_1467308552_xxxx,Storage,206480056,,,,,,2016-07-01 00:42:32,2016-07-01 01:42:32odps_test,1706596874_1467313244_xxxx,Storage,206480056,,,,,,2016-07-01 02:00:44,2016-07-01 03:00:44
You can run the desc instance InstanceID; command on your MaxCompute client 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';
If you want to see how to calculate the costs for an SQL task, download the usage records for the task as a CSV file to your computer, and view ComputationSql in the Type column. The billing for an SQL task is calculated as follows:
Computation costs of an SQL task = DataInputSize x ComputationSqlComplexity x SQL price
For more information, see Computation pricing.
In the following figure, the costs of the SQL task (whose MeteringId is 20171106100629865g4iplf9) are calculated as follows:
(7,352,600,872 bytes/1024/1024/1024) x 1 x 0.0438 USD/GB/unit of complexity = 0.3 USD


If you use external tables, such as external OTS and OSS tables, the preceding figure also includes the billable items InputOTS and InputOSS. The costs of an external table SQL task are calculated as follows:
Computation costs of an SQL task = DataInputSize x ComputationSqlComplexity x SQL price
For the preceding code, the costs of an SQL task are 0.0438 USD for every GB for each unit of complexity. For SQL tasks, one unit of complexity is applied.

If you want to see how the fees are generated and possible issues with the fees, you can copy the URL of Log view to the address box of a browser. In the following figure, you can find full table scan and long-tail traffic issues by using Log view. For more information, see Optimize long-tail traffic.



Note Log view calculates the amount of resources and time used for computations. The charges for an SQL task are calculated according to the size of data measured after compression. You can download usage records as a file (approximately 10 MB in size). If the file size exceeds 10 MB, you need to open a ticket on Alibaba Cloud.

Estimate SQL task charges

If you use DataWorks to develop MaxCompute SQL statements, you can use the fee estimation function on DataWorks GUIs to estimate fees for SQL tasks.

Alternatively, you can run the COST SQL command or call the SQLCostTask SDK API action to estimate fees for SQL tasks.

Fees-related questions

  • Are my data uploads and downloads billed?

    You can check for charges generated from data uploads and downloads by completing the following steps:

    1. In the left-side navigation pane, choose Instance Spending Details. Next, check on the Instance Spending Details page whether data uploads and downloads are billed.

      In the following figure, the Class Code does not appear. However, a total of 0.103 USD is charged for data downloads.



    2. Export usage records as a CSV file, and analyze the billing details for data downloads. DownloadEx in the Type column is the billable item for data downloads from the Internet.

    3. 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 as follows according to :
      (38,199,736 bytes/1024/1024/1024) x 0.1166 USD/GB = 0.004 USD
    4. Optimize data downloads.

      You can also check whether the service that is configured for your tunnel is billed because Internet access is enabled. For more information, see Access to domains and data centers.

      For example, if you are using the Huadong 2 Shanghai region, you can download data to your VM through Elastic Compute Service (ECS) in this region, and then use your ECS subscription to download the data.

  • How is storage of less than one day billed?

    According to Computation pricing, storage of less than one day (that is, 24 hours or less) is calculated as follows:

    100 GB x 0.0028 USD/GB/day + (333,507,833,900 bytes/1024/1024/1024 - 100) GB x 0.0096 USD/GB/day = 0.28 USD/day + 0.29 USD/day= 0.57 USD/day

    Following this, for example, storage of 15 hours is calculated as follows:

    0.57 x 15/24 = 0.36 (USD)

    You can learn about your actual situation by completing the following steps:

    Export usage records as a CSV file, and analyze the billing details for storage:



    View Storage in the Type 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 starting from 9:07. A total of 15 hours are charged for storage.

    Firstly, storage of 24 hours is calculated as follows according toStorage Pricing(Billing by quantity) :

    100 GB x 0.0014 USD/GB/day + (333,507,833,900 bytes/1024/1024/1024 – 100) GB x 0.0014 USD/GB/day = 0.14 + 0.29 = 0.43 USD/day

    Then, storage of 15 hours is calculated as follows:

    0.43 x 15/24 = 0.27 USD