EMR Serverless Spark costs are divided into workspace and cache cluster, covering three billing items: computing resources, model calls, and cache resources. Multiple billing methods are available, including pay-as-you-go and subscription. This topic covers each billing item and how to estimate usage.
Billing composition
The following diagram shows the cost breakdown.
Billing methods
EMR Serverless Spark supports the following billing methods:
|
Billing method |
Description |
|
Pay after use. Billed hourly (at the top of each hour, UTC+8) based on actual resource usage. Best for variable workloads. |
|
|
Pay before use. You prepay for a fixed duration. Price is calculated per billing cycle based on subscription length. Best for stable, long-term workloads with predictable budgets. |
|
|
Add elastic computing resources to your subscription. Combines the flexibility of pay-as-you-go with the cost efficiency of subscription. |
|
|
Purchase a discounted resource plan in advance. Usage is first deducted from the plan; excess is billed at pay-as-you-go rates. Best for relatively stable workloads. |
|
|
Billed based on actual token usage of built-in AI Center models in the workspace. |
|
|
Pay after use. Billed hourly (at the top of each hour, UTC+8) based on the allocated cache quota and usage duration. Best for Serverless Spark jobs that need faster data loading. |
Billing item details
Computing resources
Computing resources are billed based on your subscription plan or actual pay-as-you-go usage. The unit of measurement is CU.
1 CU = 1 vCPU + 4 GiB memory, the basic computing unit for EMR Serverless Spark. CU usage depends on data volume, computational complexity, data distribution, and whether you enable the Fusion engine. The Fusion engine does not increase costs and typically reduces job runtime by over 30%.
If your vCPU-to-memory ratio is below 1:4, the EMR Serverless Spark CU promotions page explains the CU conversion.
Processing capacity of 1 CU:
|
Processing scenario |
Processing capacity (Java Runtime) |
Processing capacity (Fusion engine) |
|
Simple data processing, such as filtering and scrubbing. |
1 CU processes about 2,000,000 records per second. |
1 CU processes about 5,000,000 records per second. |
|
Complex data processing, such as aggregation, joins, and string operations. |
1 CU processes about 700,000 records per second. |
1 CU processes about 2,000,000 records per second. |
Model calls
Model calls are billed based on actual usage of built-in AI Center model services. The unit is thousands of Tokens.
Token estimation: • 1 Chinese character ≈ 1.5–2 Tokens • 1 English letter ≈ 0.25 Tokens • 1 English word ≈ 1.3 Tokens
-
Alibaba Cloud Model Studio: ≈ 4–5 Tokens -
Hello World: ≈ 2 Tokens
For example, to mask 1,000 text records in a batch, use the following SQL:
select
ai_query (
concat(
'Mask the following text according to these rules:
1. Chinese names: Detect all Chinese names (2–4 characters). Keep the first and last characters. Replace middle characters with `*`.
2. Mobile phone numbers: Detect Chinese mainland mobile numbers (11 digits, starting with 1). Keep the first 3 and last 4 digits. Replace the middle 4 digits with `****`.
3. Physical addresses: Detect specific physical address information, such as province, city, district, street, and building number. Keep only the province, city, and district (county) levels. Replace all detailed street, building number, and community names after the district/county level with `***`.
Output requirements:
Return only the following three lines. Do not include explanations, original text, or other content:
Name: [result]
Mobile: [result]
Address: [result]',
user_info
)
)AS masked_text
from
user_tbl
;
For example, a user_info value can be: “Mr. Li Si lives at No. xxx, Moumou Road, Zhangjiang Hi-Tech Park, Pudong New Area, Shanghai. His mobile number is 159********.”
The estimated token usage for one record is as follows:
|
Estimated Token usage |
|
|
user_info input data |
≈ 60 |
|
prompt |
≈ 200 |
|
output data |
≈ 50 |
Estimated token usage for 10,000 records:
|
Estimated usage |
Calculation formula |
|
|
Input Tokens (estimated) |
≈ 2,600 thousand Tokens |
(60 + 200) Tokens/record × 10,000 records |
|
Output Tokens (estimated) |
≈ 500 thousand Tokens |
50 Tokens/record × 10,000 records |
Cache cluster
Cache clusters are billed based on the allocated cache quota and usage duration. The unit is GB. For billing rules, billing cycles, and regional pricing, see Data caching (pay-as-you-go).