Cloud Function

更新时间:
复制 MD 格式

This topic describes the billing rules and provides a pricing example for Cloud Function.

Billing rules

Cloud Function is billed based on three billable items: resource usage, invocations, and outbound traffic.

Billable item

Description

Billing cycle

Billing formula

Resource usage

Cloud Function is billed daily based on the total resources consumed by all function instances. To simplify the billing model, Cloud Function converts compute power into memory size (GB).

Daily. Fees are automatically deducted from your account.

Memory (GB) × execution duration (seconds) × unit price

Invocations

Cloud Function is billed daily based on the total number of invocations.

Daily. Fees are automatically deducted from your account.

Total invocations × unit price

Outbound traffic

Cloud Function is billed daily based on the total outbound traffic consumed.

Daily. Fees are automatically deducted from your account.

Outbound traffic cost = (Data transfer from function-initiated requests + Data transfer from function responses) × unit price

  • Data transfer from function-initiated requests: Traffic generated by a function's requests to the public internet.

  • Data transfer from function responses: Traffic generated when a function responds to an invocation from the public internet.

Note
  • Inbound traffic is not billed. For example, responses to a function's network requests are free of charge.

  • Outbound traffic is billed in 1 KB increments.

Note

Hourly minimum charge for resource usage

Starting at 00:00:00 on March 16, 2026 (UTC+8), an hourly minimum charge rule applies to Cloud Function resource usage (GB-seconds):

  • When calculating the daily bill, the system first evaluates resource consumption for each function on an hourly basis.

  • If a function consumes resources in a given hour (that is, GB-seconds > 0), the resource usage fee for that hour will be at least CNY 0.01.

    • If the calculated cost is ≥ CNY 0.01, the charge is the actual amount.

    • If the calculated cost is < CNY 0.01, the charge is CNY 0.01.

  • Functions that do not run are not billed.

  • Billing change notice: [Billing Change] EMAS Serverless Cloud Function Billing Rule Update.

Pricing examples

The following example uses pay-as-you-go unit prices to calculate the daily bill.

Example

Memory

Invocations

Execution duration

Outbound traffic

Daily bill

512 MB

100,000

1 second/invocation

1 GB

CNY 6.46

Formulas:

  • Function Invocation Cost: 100,000 invocations × (CNY 0.0133 / 10,000 invocations) = CNY 0.133

  • Resource Usage Cost: (512 MB / 1,024 MB/GB) × 100,000 invocations × (1 second/invocation) × (CNY 0.000110592 / GB-second) = CNY 5.5296

  • Outbound Traffic Cost: 1 GB × (CNY 0.8 / GB) = CNY 0.8

  • Total Cost = Function Invocation Cost + Resource Usage Cost + Outbound Traffic Cost = CNY 6.46

Note

In this example, the resource usage cost is ≥ CNY 0.01, so the minimum charge rule is not triggered. In an actual bill, if the resource usage fee for a given hour is less than CNY 0.01, the minimum charge rule adjusts the fee for that hour to CNY 0.01.