Pay-as-you-go

更新时间:
复制 MD 格式

Pay only for the Function Compute resources you use — no upfront commitment required. All billable items are converted to a unified unit called CU (Compute Unit), priced monthly on a tiered basis.

Prices

CU usage is billed monthly on a tiered basis.

TierMonthly CU usageUnit priceDiscounted unit price (August 27, 2024 – August 27, 2025)
1(0, 100 million] CUUSD 0.000020/CUUSD 0.0000160/CU
2(100 million, 500 million] CUUSD 0.000017/CUUSD 0.0000136/CU
3> 500 million CUUSD 0.000014/CUUSD 0.0000112/CU

Tier

CU usage (Unit: CU)

Unit price

Discounted unit price

Promotion period: August 27, 2024 to August 27, 2026

Tier 1

(0, 200 million]

CNY 0.00011/CU

CNY 0.000088/CU

Tier 2

(200 million, 1 billion]

CNY 0.00010/CU

CNY 0.000080/CU

Tier 3

>1 billion

CNY 0.00009/CU

CNY 0.000072/CU

How billing works

Conversion factors

All resource usage is converted to CU using this formula:

CU usage = Resource usage × CU conversion factor

Billable itemUnitCU conversion factor
Function invocationsCU/10,000 invocations75
Active vCPU usageCU/vCPU-second1
Idle vCPU usageCU/vCPU-second0
Memory usageCU/GB-second0.15
Disk usageCU/GB-second0.05
Tesla series — active GPU usageCU/GB-second2.1
Tesla series — idle GPU usageCU/GB-second0.5
Ada series — active GPU usageCU/GB-second1.5
Ada series — idle GPU usageCU/GB-second0.25
Note

Idle vCPU usage has a conversion factor of 0, so idle CPU time is not billed. GPU idle time is billed at a reduced rate compared to active GPU time.

Billing granularity

The minimum billing increment depends on the instance type and mode.

Instance typeOn-demand modeProvisioned mode
CPU-accelerated instancesMilliseconds10 seconds (partial tens rounded up to the nearest 10)
GPU-accelerated instances1 second (partial seconds rounded up)

CPU-accelerated instances, provisioned mode examples:

  • 51 seconds of execution → billed as 60 seconds

  • 61 seconds of execution → billed as 70 seconds

GPU-accelerated instances, on-demand mode examples:

  • 51 milliseconds of execution → billed as 1 second

  • 10.5 seconds of execution → billed as 11 seconds

Calculation example

The following example shows how to estimate a monthly bill for a typical CPU-accelerated function workload.

Assumptions:

  • 5 million invocations per month

  • Average execution duration: 200 ms per invocation

  • Memory: 0.5 GB per instance

  • vCPU: 0.5 vCPU per instance

  • Instance type: on-demand, CPU-accelerated

Step 1: Calculate CU from invocations

5,000,000 invocations ÷ 10,000 × 75 = 37,500 CU

Step 2: Calculate CU from active vCPU usage

Total execution time = 5,000,000 × 0.2 s = 1,000,000 seconds
Active vCPU-seconds = 1,000,000 s × 0.5 vCPU = 500,000 vCPU-seconds
CU from vCPU = 500,000 × 1 = 500,000 CU

Step 3: Calculate CU from memory usage

GB-seconds = 5,000,000 × 0.2 s × 0.5 GB = 500,000 GB-seconds
CU from memory = 500,000 × 0.15 = 75,000 CU

Step 4: Total CU and cost

Total CU = 37,500 + 500,000 + 75,000 = 612,500 CU

Tier 1 (first 100 million CU): 612,500 × USD 0.000020 = USD 12.25

Total estimated monthly cost: USD 12.25

Note

This is an estimate. Actual costs depend on your function's exact execution duration, memory allocation, and invocation count.

Billing cycle

Bills are generated hourly. Each hour's bill is issued 1–2 hours after the hour ends.

Within each billing cycle:

  1. CU usage for each function is measured and rounded up.

  2. CU usage across all functions is summed to calculate the total fee.

  3. Fees are automatically deducted from your account balance.

View detailed billing records in the Expenses and Costs console.

Key concepts

CU (Compute Unit) The unified billing unit for Function Compute. All resource usage — invocations, vCPU, memory, disk, and GPU — is converted to CU before pricing is applied.

On-demand mode Function Compute automatically allocates and releases instances. Billing starts when an instance begins executing a request and stops when the request completes.

Provisioned mode You allocate and release instances manually. Billing starts when Function Compute allocates the instance and stops when you release it.

Important

In provisioned mode, charges apply as long as instances are allocated, even if they process no requests. Release provisioned instances promptly when they are no longer needed. For details, see Modify or delete a provisioned instance policy.

Idle mode An optional feature for elastic and GPU-accelerated instances. When idle mode is enabled, instances are classified as active (processing requests) or idle (not processing requests). Idle CPU time is not billed; idle GPU time is billed at a reduced rate.

Execution duration The period during which an instance runs. How it is measured depends on the instance mode:

  • On-demand: from the start of request execution to completion

  • Provisioned: from instance allocation to instance release

What's next