Billing overview

更新时间:
复制 MD 格式

Function Compute bills on two items: CU (Compute Unit) usage and outbound Internet traffic. CU usage is a unified metric that converts all resource consumption — invocations, CPU, memory, disk, and GPU — into a single billable dimension. Outbound Internet traffic is billed through Cloud Data Transfer (CDT).

Starting from 00:00 on January 5, 2024, outbound Internet traffic from Function Compute is billed through CDT. For billing rules, see Supported services and [Product changes] Change of free Internet traffic quota.

Resource usage from all RAM users under an Alibaba Cloud account is aggregated and billed at the account level. To view usage, go to the Function Compute console and check the Resource Usage Statistics section on the Overview page.

How billing works

Function Compute measures seven resource usage items per function invocation. These items are not billed directly — they are converted to CU usage using fixed conversion factors, then billed based on monthly CU price tiers.

Resource usage (invocations, vCPU, memory, disk, GPU)
    × CU conversion factor
    = CU usage
    × unit price (tiered monthly)
    = cost
Important

Resource usage is calculated based on the specifications you configure for your function, not actual resource consumption during execution. For example, if you configure 1 vCPU but the function uses only 0.3 vCPU during a run, you are billed for 1 vCPU.

Starting August 27, 2024, the original billable items of Function Compute, including the number of function invocations, active vCPU usage, idle vCPU usage, memory usage, active GPU usage, idle GPU usage, and disk usage, are no longer used. The preceding resource usage is converted to CU usage based on the conversion factors. You are charged based on the prices of CU usage.

Billing cycle

Function Compute bills on an hourly basis. CU usage per function per hour is rounded up, then summed across all functions to produce the total hourly CU usage. If you have a resource plan, it offsets CU usage first. After the resource plan is exhausted or expires, hourly fees apply.

CU usage is priced monthly on a tiered basis — the higher your monthly total, the lower the per-unit price.

CU pricing

Starting August 27, 2024, Function Compute uses CU usage as the sole billable item for resource consumption.

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

CU conversion factors

Each resource usage item converts to CU usage using a fixed factor: resource usage × conversion factor = CU usage.

Resource Unit CU conversion factor Free tier
Function invocations per 10,000 invocations 75 CU
Active vCPU usage per vCPU-second 1 CU
Idle vCPU usage per vCPU-second 0 CU Free (no charge)
Memory usage per GB-second 0.15 CU
Disk usage per GB-second 0.05 CU First 512 MB free
Tesla series — active GPU usage per GB-second 2.1 CU
Tesla series — idle GPU usage per GB-second 0.5 CU
Ada series — active GPU usage per GB-second 1.5 CU
Ada series — idle GPU usage per GB-second 0.25 CU

Resource usage items

The following table lists the seven resource usage items, their units, and calculation formulas. These items feed into CU conversion and do not appear directly on your bill.

Resource Unit Formula Calculation example
Function invocations 1 invocation per function execution
Active vCPU usage vCPU-second vCPU spec × execution duration (s) 1 vCPU × 1.5 s = 1.5 vCPU-seconds
Idle vCPU usage vCPU-second vCPU spec × idle duration (s) Free (0 CU/vCPU-second)
Memory usage GB-second Memory spec (GB) × execution duration (s) 0.5 GB × 1.5 s = 0.75 GB-seconds
Disk usage GB-second (Disk spec − 0.5 GB) × execution duration (s) (10 − 0.5) GB × 1 s = 9.5 GB-seconds
Active GPU usage (Tesla or Ada) GB-second GPU memory (GB) × execution duration (s) 48 GB × 1 s = 48 GB-seconds
Idle GPU usage (Tesla or Ada) GB-second GPU memory (GB) × idle duration (s)

Execution duration and idle duration

Execution duration

Execution duration is measured from when a function instance starts executing a request to when the request completes.

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

  • Provisioned mode: You allocate and release instances. Billing starts when Function Compute allocates the provisioned instance and ends when you release it. If provisioned instances are not processing requests and idle mode is not enabled, active-mode fees continue to accrue. Release idle provisioned instances promptly to avoid unnecessary charges. See Configure provisioned instances.

Idle duration

For provisioned instances with idle mode enabled, an instance enters the idle state when no requests are being processed. Idle resource usage is calculated as the configured specification multiplied by the idle duration.

  • CPU instances: Idle mode is enabled by default.

  • GPU-accelerated instances: Idle mode is disabled by default. Enable it manually if needed.

When a provisioned instance is idle, Function Compute freezes its GPU or vCPU resources and charges at significantly lower rates.

Fee formula for provisioned instances with idle mode enabled:

Fee = (total idle resource usage × idle unit price)
    + (total active resource usage × active unit price)
image

For active-only provisioned instances (idle mode disabled):

image

Billing examples

The following examples show how to calculate monthly costs for different workload types and scales. Find the example closest to your usage pattern to estimate your costs.

Example 1: Large-scale workload with GPU (on-demand)

Scenario: A compute-intensive workload with 12 billion monthly invocations and Tesla GPU usage.

Resource Monthly usage Conversion factor CU usage
Function invocations 12,000,000,000 0.0075 CU/invocation 90,000,000 CU
Active vCPU usage 800,000,000 vCPU-seconds 1 CU/vCPU-second 800,000,000 CU
Memory usage 2,000,000,000 GB-seconds 0.15 CU/GB-second 300,000,000 CU
Disk usage 0 GB-seconds 0.05 CU/GB-second 0 CU
Tesla series — active GPU usage 100,000,000 GB-seconds 2.1 CU/GB-second 210,000,000 CU
Tesla series — idle GPU usage 400,000,000 GB-seconds 0.5 CU/GB-second 200,000,000 CU
Total 1,600,000,000 CU

Fee = USD 0.000020 × 100,000,000 + USD 0.000017 × 400,000,000 + USD 0.000014 × 1,100,000,000 = USD 24,200

Example 2: Provisioned CPU instance

Scenario: A function with 0.35 vCPU, 512 MB memory, and 512 MB disk. Provisioned for 50 hours — 10 hours active, 40 hours idle — with 1 million invocations.

For provisioned CPU instances, memory and disk usage are billed for the full provisioned duration. Active vCPU usage is billed only for the active duration.
Resource Usage Conversion factor CU usage
Active vCPU usage 12,600 vCPU-seconds 1 CU/vCPU-second 12,600 CU
Idle vCPU usage 50,400 vCPU-seconds 0 CU/vCPU-second 0 CU (no charge)
Memory usage 90,000 GB-seconds 0.15 CU/GB-second 13,500 CU
Disk usage 0 GB-seconds 0.05 CU/GB-second 0 CU (first 512 MB free)
Function invocations 1,000,000 0.0075 CU/invocation 7,500 CU
Total 33,600 CU

Total fee = Tier 1 unit price × Usage = CNY 0.00011/CU × 33,600 CU = CNY 3.7

Fee = USD 0.000020 × 33,600 = USD 0.67

Example 3: Provisioned GPU-accelerated instance

Scenario: A function with 16 GB Tesla GPU, 8 vCPU, 32 GB memory, and 512 MB disk. Provisioned for 50 hours — 10 hours active, 40 hours idle — with 1 million invocations.

For provisioned GPU-accelerated instances, memory and disk usage are billed for the full provisioned duration. Active vCPU and GPU usage is billed only for the active duration. vCPU and GPU resources are frozen during the idle state.
Resource Usage Conversion factor CU usage
Active vCPU usage 288,000 vCPU-seconds 1 CU/vCPU-second 288,000 CU
Idle vCPU usage 1,152,000 vCPU-seconds 0 CU/vCPU-second 0 CU (no charge)
Memory usage 5,760,000 GB-seconds 0.15 CU/GB-second 864,000 CU
Disk usage 0 GB-seconds 0.05 CU/GB-second 0 CU (first 512 MB free)
Tesla series — active GPU usage 576,000 GB-seconds 2.1 CU/GB-second 1,209,600 CU
Tesla series — idle GPU usage 2,304,000 GB-seconds 0.5 CU/GB-second 1,152,000 CU
Function invocations 1,000,000 0.0075 CU/invocation 7,500 CU
Total 3,521,100 CU

Total cost = Tier 1 unit price × Usage = CNY 0.00011/CU × 3,290,700 CU = CNY 361.977

Fee = USD 0.000020 × 3,521,100 = USD 70.42

FAQ