MaxCompute supports the pay-as-you-go billing method for SQL, MapReduce, Spark, Mars, and MaxCompute Query Acceleration (MCQA) jobs.

Note MaxCompute sends you a notification when you have an overdue payment. To continue your access to MaxCompute resources, we recommend that you settle your overdue payments within the prescribed time limit. If you have any questions, submit a ticket.
MaxCompute supports the following billing methods:
  • Pay-as-you-go: Each job is billed based on the resources you consume after you execute a job. This billing method is used for standard SQL jobs, SQL jobs that reference external tables, MapReduce, Spark, Mars, and MCQA jobs.
  • Subscription: You must purchase resources before you can use them. MaxCompute reserves the resources that you purchase.

MaxCompute supports SQL, MapReduce, Spark, Mars, MCQA, Graph, and machine learning jobs. You are charged for the use of SQL (excluding UDF), MapReduce, and Spark jobs. Mars jobs are charged starting from September 1, 2020. MCQA jobs are charged starting from October 1, 2020. Other types of computing jobs are not charged.

Subscription

You must purchase resources before you can use them. MaxCompute reserves the resources that you purchase. The amount of computing resources is calculated based on the compute units (CUs). One CU is equivalent to 4 GB of memory and 1 CPU core. The subscription billing method applies to the computing resources that you consume for jobs such as SQL, MapReduce, and Spark jobs.
Resource Memory CPU Price (USD/month)
1 CU 4 GB 1 CPU 22.0

After you purchase subscription computing resources, you can monitor and manage the resources by using MaxCompute Management. For more information, see Use MaxCompute Management.

If you are a new MaxCompute user, we recommend that you select the pay-as-you-go billing method. When you select the subscription billing method, you purchase a specific amount of computing resources. As a new user, you may consume less resources than what you purchase. Other resources may remain idle. The pay-as-you-go billing method is more cost-effective because you are billed based on the exact amount of resources that you consume.

Billing for standard SQL jobs

Every time you run an SQL job, MaxCompute calculates the fee based on the input data volume in computing and SQL complexity. On the following day, MaxCompute aggregates the fees for all executed SQL jobs into one bill under your Alibaba Cloud account. Then, MaxCompute deducts the fees from the balance of your Alibaba Cloud account.

MaxCompute calculates the fee for a standard SQL job based on the following formula:
Fee for a standard SQL job = Input data volume in computing × Complexity of the SQL job × Unit price of SQL jobs
The following table lists the unit price of standard SQL jobs.
Billable item Unit price
Standard SQL job USD 0.0438/GB
  • Input data volume in computing: the volume of data scanned by an SQL job. Most SQL jobs support partition filtering and column pruning. In most cases, this value is less than the data volume of the source table.
    • Partition filtering: If you submit an SQL statement that contains the WHERE clause WHERE ds > 20130101 (ds is the partition key column), only the data in the partitions that are read is billed.
    • Column pruning: If you submit the SQL statement SELECT f1,f2,f3 FROM t1;, only the data in columns f1, f2, and f3 of table t1 is billed. The data in the other columns is not billed.
  • SQL complexity: The complexity of an SQL job is calculated based on the number of keywords in the SQL statements of the SQL job.
    • Number of SQL keywords = Number of JOIN clauses + Number of GROUP BY clauses + Number of ORDER BY clauses + Number of DISTINCT keywords + Number of window functions + Max (Number of INSERT statements - 1, 1).
    • Calculation of SQL job complexity:
      • If the number of keywords is less than or equal to 3, the complexity of an SQL job is 1.
      • If the number of keywords is less than or equal to 6 but greater than or equal to 4, the complexity of an SQL job is 1.5.
      • If the number of keywords is less than or equal to 19 but greater than or equal to 7, the complexity of an SQL job is 2.
      • If the number of keywords is greater than or equal to 20, the complexity of an SQL job is 4.
You can run the following command to calculate the complexity of an SQL job:
COST SQL <SQL Sentence>;
Example:
odps@ $odps_project >COST SQL SELECT DISTINCT total1 FROM
(SELECT id1, COUNT(f1) AS total1 FROM in1 GROUP BY id1) tmp1
ORDER BY total1 DESC LIMIT 100;
Intput:1825361100.8 Bytes
Complexity:1.5
In this example, the number of keywords in the SQL statement is calculated based on the following formula: 1 DISTINCT keyword + 1 GROUP BY clause + 1 ORDER BY clause + MAX (0 - 1, 1) = 4. The complexity of the SQL job is 1.5. If the data volume to compute is 1.7 GB, the fee is calculated based on the following formula:
1.7 × 1.5 × 0.0438 = USD 0.11
Note
  • The bill is generated before 06:00 the following day.
  • Failed SQL jobs are not billed.
  • Your SQL jobs are billed based on the data volume after compression, which is similar to the storage service.

Billing for SQL jobs that reference external tables

Since March 2019, MaxCompute SQL jobs that reference external tables are charged based on the pay-as-you-go billing method.

SQL jobs that reference external tables are billed based on the following formula:
Fee of an SQL job = Input data volume in computing × Unit price of SQL jobs that reference external tables
The following table lists the unit price of SQL jobs that reference external tables.
Billable item Unit price
SQL jobs that reference external tables USD 0.0044/GB
The SQL job complexity is 1. On the following day, MaxCompute aggregates the fees for all executed SQL jobs into one bill under your Alibaba Cloud account.
Note
  • The bill is generated before 06:00 the following day.
  • For the jobs that involve both internal and external tables, MaxCompute calculates the fees for jobs that reference internal tables separately from jobs that reference external tables.
  • You cannot estimate the fees for SQL jobs that reference external tables.

Pay-as-you-go billing for MapReduce jobs

Since December 19, 2017, MaxCompute MapReduce jobs are charged based on the pay-as-you-go billing method.

MapReduce jobs are billed based on the following formula:
Fees for MapReduce jobs of the day = Number of billable hours × Unit price (USD)
The following table lists the unit price of MaxCompute MapReduce jobs.
Billable item Unit price
MapReduce job USD 0.0690/hour/job
The number of billable hours of a MapReduce job is calculated based on the following formula:
Number of billable hours of a MapReduce job = Number of job running hours × Number of CPU cores consumed

For example, if a MapReduce job that runs for 0.5 hours consumes 100 CPU cores, the number of billable hours is 50 based on the following calculation: 100 cores × 0.5 hours = 50.

After a MapReduce job is executed, MaxCompute calculates the billable hours of the job. On the following day, MaxCompute aggregates the fees for all executed MapReduce jobs into one bill under your Alibaba Cloud account. Then, MaxCompute deducts the fees from the balance of your Alibaba Cloud account.
Note
  • The bill is generated before 06:00 the following day.
  • Failed MapReduce jobs are not billed.
  • The queuing time of jobs is not counted in the billable hours.
  • If you have purchased the MaxCompute service by selecting the subscription billing method, you can execute MapReduce jobs for free within the subscription period.

Pay-as-you-go billing for Spark jobs

Since February 1, 2019, MaxCompute Spark jobs are charged based on the pay-as-you-go billing method. For more information, see MaxCompute Spark. Spark jobs are billed based on the following formula:
Fees for Spark jobs of the day = Number of billable hours × Unit price (USD 0.1041/hour/job)
The number of billable hours of a Spark job is calculated based on the following formula:
Number of billable hours of a Spark job = MAX [Number of CPU cores × Job running hours, Round up (Memory size × Number of execution hours/4)]
where:
  • You must provide the number of CPU cores consumed, number of job running hours, and memory size.
  • One billable hour is equivalent to 1 CPU core plus 4 GB of memory.

For example, if a Spark job that runs for 1 hour consumes 2 CPU cores and 5 GB of memory, the number of billable hours is 2 based on the following calculation: MAX [2 × 1, Round up (5 × 1/4)] = 2. If a Spark job that runs for 1 hour consumes 2 CPU cores and 10 GB of memory, the number of billable hours is 3 based on the following calculation: MAX [2 × 1, Round up (10 × 1/4)] = 3.

After a MaxCompute Spark job is executed, the system calculates the billable hours of the job. On the following day, MaxCompute aggregates the fees for all executed Spark jobs into one bill under your Alibaba Cloud account. Then, MaxCompute deducts the fees from the balance of your Alibaba Cloud account.
Note
  • The bill is generated before 06:00 the following day.
  • The queuing time of jobs is not counted in the billable hours.
  • The fee for the same job may vary based on the amount of specified resources.
  • If you have purchased the MaxCompute service by selecting the subscription billing method, you can run Spark jobs for free within the subscription period.
  • For any questions about the billing for Spark jobs, submit a ticket.

Pay-as-you-go billing for Mars jobs

Since September 1, 2020, MaxCompute Mars jobs are charged based on the pay-as-you-go billing method. For more information, see Mars. The Mars jobs are billed based on the following formula:
Fees for Mars jobs of the day = Number of billable hours × Unit price (USD 0.1041/hour/job)
The number of billable hours for a Mars job is calculated in the following way:
  • Calculate the number of CPU cores and memory size that are consumed by the job.
  • One billable hour is equivalent to 1 CPU core plus 4 GB of memory.
  • MaxCompute uses the following formula to calculate the fees for Mars jobs: MAX [Number of CPU cores × Number of job running hours, Round up (Memory size × Job running hours/4)].

    For example, if a Mars job that runs for 1 hour consumes 2 CPU cores and 5 GB of memory, the number of billable hours is 2 based on the following calculation: MAX [2 × 1, Round up (5 × 1/4)] = 2. If a Mars job that runs for 1 hour consumes 2 CPU cores and 10 GB of memory, the number of billable hours is 3 based on the following calculation: MAX [2 × 1, Round up (10 × 1/4)] = 3.

After a Mars job is executed, MaxCompute calculates the billable hours of the job. On the following day, MaxCompute aggregates the fees for all executed Mars jobs into one bill under your Alibaba Cloud account. Then, MaxCompute deducts the fees from the balance of your Alibaba Cloud account.

Note
  • The bill is generated before 06:00 the following day.
  • The queuing time of jobs is not counted in the billable hours.
  • The fee for the same job may vary based on the amount of specified resources.
  • If you have purchased the MaxCompute service by selecting the subscription billing method, you can execute Mars jobs for free within the subscription period.
  • For any questions about the billing for Mars jobs, submit a ticket.

Pay-as-you-go billing for MCQA jobs

Since October 1, 2020, MaxCompute MCQA jobs are charged based on the pay-as-you-go billing method. For more information, see MCQA.

Each time an MCQA job is executed, MaxCompute bills you based on the amount of input data of the job. On the following day, MaxCompute aggregates the fees for all executed MCQA jobs.

MCQA jobs are billed based on the following formula:
Fee of an MCQA job = Volume of input data for the MCQA job × Unit price (USD 0.0438/GB)
Note
  • MCQA jobs use dedicated computing resources. Even if you purchase the MaxCompute service by selecting the subscription billing method, MaxCompute bills you based on the amount of data scanned by an MCQA job when you run an MCQA job.
  • MaxCompute bills you based on the amount of data scanned by each MCQA job (at least 10 MB for each MCQA job). Canceled MCQA jobs are billed based on the amount of data scanned.
  • The bill is generated before 06:00 the following day.
  • No fee is generated if no query is performed.
  • By default, MaxCompute performs column-oriented storage and compression on data. MaxCompute calculates the amount of scanned data based on the compressed data.
  • When you query a partitioned table, you can apply partition filter conditions to reduce the data scan volume and improve query performance.
  • MaxCompute Query Acceleration (MCQA) is in public preview in the following regions: China (Hongkong), Singapore (Singapore), Indonesia (Jakarta), India (Mumbai), and Malaysia (Kuala Lumpur). It will be gradually available for other regions.