All Products
Search
Document Center

MaxCompute:Computing pricing (pay-as-you-go)

Last Updated:Jul 17, 2025

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

Note

If you have an overdue payment, the system sends you a notification. You must renew your subscription as soon as possible to prevent service suspension.

MaxCompute supports the following billing methods:

  • Pay-as-you-go: You are charged for each job based on the resources consumed by the job. This billing method applies to standard SQL jobs, SQL jobs that reference external tables, MapReduce jobs, Spark jobs, Mars jobs, MCQA jobs, and MaxFrame jobs.

  • Subscription: You can subscribe to specific resources.

MaxCompute supports SQL, MapReduce, Spark, Mars, MCQA, MaxFrame, Graph, and machine learning jobs. You are charged for SQL, MapReduce, and Spark jobs but not user-defined functions (UDFs). You are charged for Mars jobs from September 1, 2020. You are charged for MCQA jobs from October 1, 2020. You are not charged for other types of computing jobs.

Subscription

You can subscribe to specific resources. MaxCompute reserves the resources that you subscribe to. Computing resources are measured in compute units (CUs). One CU is equivalent to 4 GB of memory and 1 CPU core. The subscription billing method applies to computing resources consumed by jobs, such as SQL, MapReduce, and Spark jobs.

Resource

Memory size

CPU

Price (USD per month)

1 CU

4 GB

1 CPU

22.0

After you purchase subscription computing resources, you can monitor and manage the resources using resource observation. For more information, see Resource Monitoring.

We recommend that you select the pay-as-you-go billing method the first time you use MaxCompute. If you select the subscription billing method, you purchase a specific amount of computing resources. If you are a new user, you may consume fewer resources than the purchased resources. Some resources may remain idle. In this case, we recommend that you use the pay-as-you-go billing method. The pay-as-you-go billing method is more cost-effective because you are charged based on the amount of resources that you consume.

Billing for standard SQL jobs

Each time you run an SQL job, MaxCompute calculates the fee based on the Amount Of Input Data In Computing and SQL Complexity. On the following day, MaxCompute aggregates the fees for all executed SQL jobs into one bill within 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 = Amount of input data in computing × SQL complexity × Unit price of a standard SQL job

The following table describes the unit price of a standard SQL job.

Item

Unit price

SQL pricing

USD 0.0438 per GB

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.05256 per GB.

  • Amount Of Input Data In Computing: the amount of data scanned by an SQL job. Most SQL jobs support partition filtering and column pruning. Therefore, in most cases, this value is less than the amount of data in the source table.

    • Partition filtering: If you submit an SQL statement that contains the WHERE ds > 20130101 clause. ds in the clause is the partition key column. You are charged only for the data in the partitions that are read.

    • Column pruning: If you submit the SQL statement SELECT f1,f2,f3 FROM t1;, you are charged only for the data in columns f1, f2, and f3 of table t1. You are not charged for the data in the other columns.

  • 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 clauses + Number of window functions + MAX(Number of INSERT statements|Number of UPDATE statements|Number of DELETE statements - 1, 1).

    • Calculation of SQL complexity:

      • If the number of SQL keywords is less than or equal to 3, the complexity of an SQL job is 1.

      • If the number of SQL 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 SQL 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 SQL keywords is greater than or equal to 20, the complexity of an SQL job is 4.

    For more information about SQL keywords, see JOIN, GROUP BY, ORDER BY, Window functions, INSERT, UPDATE|DELETE.

You can run the following command to calculate the complexity of an SQL job:

COST SQL <SQL Sentence>;

Examples:

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 is calculated based on the following formula: 1 DISTINCT clause + 1 GROUP BY clause + 1 ORDER BY clause + MAX(0 - 1, 1) = 4. The complexity of the SQL job is 1.5. If the amount of data that needs to be computed is 1.7 GB, the fee is calculated based on the following formula:

1.7 × 1.5 × 0.0438 = 0.11 USD
Note
  • The bill is generated before 06:00 on the following day.

  • You are not charged for failed SQL jobs.

  • You are charged for SQL jobs based on the amount of data after compression, which is similar to the storage service.

Billing for SQL jobs that reference external tables

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

You are charged for SQL jobs that reference external tables using the following formula:

Fee for an SQL job = Amount of input data in computing × Unit price of SQL jobs that reference external tables

The following table describes the unit price of SQL jobs that reference external tables.

Item

Unit price

SQL Pricing

USD 0.0044 per GB

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.00528 per GB.

The SQL complexity is 1. On the following day, MaxCompute aggregates the fees for all executed SQL jobs into one bill within your Alibaba Cloud account.

Note
  • The bill is generated before 06:00 on the following day.

  • For jobs that reference internal and external tables, MaxCompute separately calculates the fees for jobs that reference internal tables and 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, you are charged for MaxCompute MapReduce jobs based on the pay-as-you-go billing method.

You are charged for MapReduce jobs using the following formula:

Fee for MapReduce jobs of the day = Number of billable hours × Unit price (USD per hour)

The following table describes the unit price of a MaxCompute MapReduce job.

Item

Unit price

MapReduce Pricing

USD 0.0690 per hour

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.0828 per hour.

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 hours for which a job runs × Number of CPU cores consumed by the job

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 formula: 100 cores × 0.5 hours = 50.

After a MapReduce job is run, MaxCompute calculates the billable hours of the job. On the following day, MaxCompute aggregates the fees for all executed MapReduce jobs into one bill within 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 on the following day.

  • You are not charged for failed MapReduce jobs.

  • The queuing time of jobs is not counted in the billable hours.

  • If you select the subscription billing method for MaxCompute, you can run MapReduce jobs free of charge within the subscription period.

Pay-as-you-go billing for Spark jobs

Since February 1, 2019, you are charged for Spark jobs based on the pay-as-you-go billing method. For more information, see MaxCompute Spark. You are charged for Spark jobs based on the following formula:

Fee for Spark jobs of the day = Number of billable hours × Unit price (USD 0.1041 per hour)

The following table describes the unit price of a Spark job.

Item

Unit price

Spark Pricing

USD 0.1041 per hour

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.12492 per hour.

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 × Number of hours for which a job runs, ROUND UP(Memory size × Number of hours for which a job runs/4)]

Where:

  • You must provide the number of CPU cores consumed, number of hours for which a job runs, and memory size.

  • One billable hour is equivalent to 1 CPU core and 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 formula: 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 formula: MAX[2 × 1, ROUND UP(10 × 1/4)] = 3.

After a Spark job is run, MaxCompute calculates the billable hours of the job. On the following day, MaxCompute aggregates the fees for all executed Spark jobs into one bill within 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 on the following day.

  • The queuing time of jobs is not counted in the billable hours.

  • The fee for similar jobs may vary based on the amount of specified resources.

  • If you select the subscription billing method for MaxCompute, you can run Spark jobs free of charge within the subscription period.

Pay-as-you-go billing for Mars jobs

Since September 1, 2020, you are charged for MaxCompute Mars jobs based on the pay-as-you-go billing method. For more information, see Data science (Mars). You are charged for Mars jobs based on the following formula:

Fee for Mars jobs of the day = Number of billable hours × Unit price (USD 0.1041 per hour)

The following table describes the unit price of a Mars job.

Item

Unit price

Data Science (Mars) Pricing

USD 0.1041 per hour

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.12492 per hour.

The number of billable hours for a Mars job is calculated using the following method:

  • Calculate the number of CPU cores and memory size that are consumed by the job.

  • One billable hour is equivalent to 1 CPU core and 4 GB of memory.

  • The formula is MAX(CPU × Duration, CEILING(Memory × Duration / 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 formula: 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 formula: MAX[2 × 1, ROUND UP(10 × 1/4)] = 3.

After a Mars job is run, MaxCompute calculates the billable hours of the job. On the following day, MaxCompute aggregates the fees for all executed Mars jobs into one bill within 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 on the following day.

  • The queuing time of jobs is not counted in the billable hours.

  • The fee for similar jobs may vary based on the amount of specified resources.

  • If you select the subscription billing method for MaxCompute, you can run Mars jobs free of charge within the subscription period.

Pay-as-you-go billing for MCQA jobs

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

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

You are charged for MCQA jobs based on the following formula:

Fee for an MCQA job = Amount of input data for the MCQA job × Unit price (USD 0.0438 per GB)

The following table describes the unit price of a MCQA job.

Item

Unit price

Query Acceleration (MCQA) Pricing

USD 0.0438 per GB

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.05256 per GB.

Note
  • MCQA jobs use dedicated computing resources. If you select the subscription billing method for MaxCompute, MaxCompute calculates the fee based on the amount of data scanned by an MCQA job when you run the MCQA job.

  • MaxCompute calculates the fee based on the amount of data scanned by each MCQA job. Each MCQA job scans at least 10 MB of data. You are charged for canceled MCQA jobs based on the amount of data scanned.

  • The bill is generated before 06:00 on 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 use partition filtering conditions to reduce the amount of scanned data and improve query performance.

  • MCQA is in public preview in the following regions: China (Hong Kong), Singapore, Indonesia (Jakarta) and Malaysia (Kuala Lumpur). MCQA is pending release in other regions.

Pay-as-you-go billing for MaxFrame jobs

After a MaxFrame job is run, MaxCompute calculates the CU-hours (billable hours) consumed by the job. On the following day, MaxCompute aggregates the fees for all MaxFrame jobs into one bill within your Alibaba Cloud account before 06:00. Then, MaxCompute deducts the fees from the balance of your Alibaba Cloud account.

Note
  • If you select the subscription billing method for MaxCompute, you can run MaxFrame jobs free of charge within the subscription period.

  • MaxFrame pay-as-you-go billing is available in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Ulanqab), China (Shenzhen), China (Chengdu), China (Hong Kong), Japan (Tokyo), Singapore, Indonesia (Jakarta), Germany (Frankfurt), US (Silicon Valley), US (Virginia), and Finance Cloud China (Hangzhou).

  • If you have any questions or need assistance, you can contact us by filling out the DingTalk group application form to join the MaxCompute Developer Community group (DingTalk group number: 11782920), your dedicated DingTalk group, or the MaxFrame Official User Support group (DingTalk group number: 37130012987).

You are charged for MaxFrame jobs based on the following formula:

Fee for MaxFrame jobs of the day = Number of billable hours × Unit price

The following table describes the billing rules for MaxFrame jobs.

Item

Unit price

Standard MaxFrame job

(MaxFrame jobs that use pay-as-you-go standard edition computing quota)

USD 0.0541 per hour

Note

The SAU (Riyadh - Partner Region) region is operated by a partner, with a unit price of USD 0.06496 per GB.

References

  • If you want to know the distribution of your MaxCompute fees and prevent the fees from exceeding your expectations when you use MaxCompute, you can obtain and analyze your MaxCompute bills to maximize resource utilization and reduce costs. For more information, see Analyze the usage records of MaxCompute bills.

  • Fees are incurred when you use MaxCompute for development. If daily consumption is stable most of the time but the fees surge in a specific period, you can perform a cost analysis to identify the projects and jobs that cause the surges, except for surges due to business growth. Then, you can optimize and adjust the jobs as soon as possible to optimize costs. For more information, see Troubleshoot an unexpected surge in the postpaid fees of MaxCompute.