Pay-as-you-go

更新时间:
复制 MD 格式

With pay-as-you-go billing, you pay only for the Function Compute resources you use—no upfront commitment required. Fees are calculated from actual resource consumption and billed hourly.

Prices

CU usage is billed monthly on a tiered basis. The tier is determined by your total CU usage accumulated within the month.

Tier CU usage Unit price Discounted unit price (August 27, 2024 – August 27, 2025)
1 0–100 million CU USD 0.000020/CU USD 0.0000160/CU
2 100 million–500 million CU USD 0.000017/CU USD 0.0000136/CU
3 > 500 million CU USD 0.000014/CU USD 0.0000112/CU

How CU usage is calculated

All billable resources are converted to compute units (CU) using this formula:

Resource usage × Conversion factor = CU usage

The following table lists the conversion factors for each billable item.

Billable item Unit Conversion factor
Number of function invocations CU/10,000 invocations 75
Active vCPU usage CU/vCPU-second 1
Idle vCPU usage CU/vCPU-second 0
Memory usage CU/GB-second 0.15
Disk usage CU/GB-second 0.05
Tesla series — active GPU usage CU/GB-second 2.1
Tesla series — idle GPU usage CU/GB-second 0.5
Ada series — active GPU usage CU/GB-second 1.5
Ada series — idle GPU usage CU/GB-second 0.25

Example: estimating your monthly bill

Suppose a function runs with the following configuration:

  • 3 million invocations per month

  • 512 MB (0.5 GB) memory

  • Average execution duration: 200 ms per invocation

  • 0.25 vCPU allocated

  • No GPU

Step 1: Calculate invocation CU

3,000,000 invocations ÷ 10,000 × 75 = 22,500 CU

Step 2: Calculate memory CU

Total execution time = 3,000,000 × 0.2 s = 600,000 seconds

Total memory usage = 600,000 s × 0.5 GB = 300,000 GB-seconds

300,000 GB-seconds × 0.15 = 45,000 CU

Step 3: Calculate active vCPU CU

Total vCPU-seconds = 3,000,000 × 0.2 s × 0.25 vCPU = 150,000 vCPU-seconds

150,000 × 1 = 150,000 CU

Step 4: Total CU usage

22,500 + 45,000 + 150,000 = 217,500 CU

Step 5: Monthly cost (Tier 1 applies; standard unit price)

217,500 × USD 0.000020 = USD 4.35/month

Key concepts

Idle mode

When idle mode is enabled, CPU and GPU-accelerated instances are classified as either active or idle based on whether they are processing requests:

  • Active instances: instances currently processing requests

  • Idle instances: instances not processing requests

Idle vCPU usage has a conversion factor of 0, so idle CPU instances incur no CU charges for vCPU time. Idle GPU instances still incur charges at the idle GPU conversion factors.

Execution duration

The measurement of execution duration differs between on-demand and provisioned instances:

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

  • Provisioned mode: billing starts when Function Compute allocates the instance and ends when you release it. You manage the allocation and release of provisioned instances.

Important

In provisioned mode, charges apply regardless of whether instances are processing requests. To avoid unnecessary fees, release provisioned instances that are no longer needed. To automate this, configure auto scaling rules.

Billing granularity

The billing granularity depends on the instance type and mode.

Instance type On-demand mode Provisioned mode
CPU instances 1 millisecond 1 second, rounded up to the next multiple of 10 seconds. For example, 51 s is billed as 60 s; 61 s is billed as 70 s.
GPU-accelerated instances 1 second; partial seconds are rounded up. For example, 51 ms is billed as 1 s; 10.5 s is billed as 11 s.
Note

The billing cycle is 1 hour. Fees are calculated and settled on an hourly basis. For more information on how execution duration is measured in each mode, see Instance types and usage modes.

Billing cycle

Bills are generated hourly. Each hourly bill is issued 1–2 hours after that hour ends, and fees are automatically deducted from your account balance.You can view the billing details on the Bills page.

What's next