All Products
Search
Document Center

Function Compute (2.0):Billing overview

Last Updated:Apr 12, 2024

Function Compute supports the following billing methods: trial quota, pay-as-you-go, and resource plans. Billable items of Function Compute include the number of function invocations, resource usage, and outbound Internet traffic. You can purchase resource plans and use the instance concurrency feature to reduce costs.

Billing methods

This section describes the billing methods that are supported by Function Compute.

Trial quotas

Function Compute provides trial quotas for users who activate Function Compute for the first time. The trial quotas include the GPU quota, vCPU quota, memory quota, function invocation quota, and Cloud Data Transfer (CDT) Internet traffic quota. Trial quotas are valid for three months. You are charged for excess resource usage on a pay-as-you-go basis. For more information, see Trial quotas.

Resource plans

Function Compute provides four types of resource plans: vCPU resource plans, memory resource plans, GPU resource plans, and function invocation plans to offset fees of corresponding billable items. Resource plans are preferentially used to offset fees for resource usage. When quotas in your resource plans are exhausted, you are charged on a pay-as-you-go basis.

Resource plans allow you to use the same amount of resources at more favorable prices. This helps you reduce costs. For more information, see Resource plans.

Pay-as-you-go

You are charged based on computing resources that you actually consume. For more information, see Pay-as-you-go.

Billable items

Billable items of Function Compute include the number of function invocations, resource usage, and outbound Internet traffic. The following table describes the details.

Category

Billable item

Description

Billing method

Unit price and example

Number of function invocations

Number of function invocations

The number of function invocations is billed in the tiered pricing mode.

  • Pay-as-you-go

  • Resource plans

  • Trial quota: 8 million invocations upon activation

Resource usage

GPU

You are charged based on the GPU specifications that you configure for your functions. GPU usage is billed in the tiered pricing mode.

  • Pay-as-you-go

  • Resource plans

  • Trial quota: 1 million GB-seconds upon activation

vCPU

You are charged based on the vCPU specifications that you configure for your functions. vCPU usage is billed in tiered pricing mode.

  • Pay-as-you-go

  • Resource plans

  • Trial quota: 500,000 vCPU-seconds upon activation

Memory

You are charged based on the memory specifications that you configure for your functions.

  • Pay-as-you-go

  • Resource plans

  • Trial quota: 2 million GB-seconds upon activation

Disk

You are charged based on the disk specifications that you configure for your functions.

Pay-as-you-go

Outbound Internet traffic

Outbound Internet traffic

You are charged based on the total outbound Internet traffic.

Note

Starting from 00:00 on January 5, 2024, CDT is used to bill outbound Internet traffic of Function Compute. You are charged for Internet traffic based on the billing rules of CDT. For more information, see Products and metering methods supported by CDT.

Products and metering methods supported by CDT

Billing units

The following units are used for the billing of resource usage:

  • vCPU-second

    Examples of 1 vCPU-second of resource usage: an instance with 1 vCPU runs 1 second, or an instance with 0.5 vCPUs runs 2 seconds.

  • GB-second

    Example of 1 GB-second of resource usage: an instance with 1 GB of memory runs 1 second, or an instance with 512 MB of memory runs 2 seconds.

Terms

  • Idle mode: After you enable the idle mode feature, states of elastic instances and GPU-accelerated instances of Function Compute are classified into the active state and idle state based on whether they are allocated the following resources. For more information, see Idle mode.

    • Elastic instances: vCPU resources

    • GPU-accelerated instances: vCPU and GPU resources

  • Execution duration: Instances in Function Compute can be used in the provisioned and on-demand modes. Measurement of execution duration of instances in the preceding two modes is different. For more information, see Instance types and usage modes.

    • On-demand mode: Function Compute automatically allocates and releases function instances. Measurement of execution duration starts when a function starts to execute requests and ends when the requests are executed.

    • Provisioned mode: Function instances are allocated, released, and managed by yourself. Billing of a provisioned instance starts when Function Compute allocates the instance and ends when you release the instance.

Important

In the provisioned mode, you are charged for instances until you release the instances, even if the instances do not process any requests. If your provisioned instances do not process any requests and fees continue to incur, release the instances at the earliest opportunity. For more information, see Configure auto scaling rules.

Number of function invocations

Note

Starting from 00:00:00 on January 1, 2024, you are no longer charged for the number of function invocations for requests sent from Alibaba Cloud message services and CloudFlow to Function Compute. The number of function invocations for requests sent from these Alibaba Cloud services is not included in the cumulative number of invocations for tiered pricing. For more information, see [Product changes] Fee reduction for requests from Alibaba Cloud message services and CloudFlow.

The number of function invocations in Function Compute is billed in the tiered pricing mode. Bills are generated on an hourly basis based on the total number of monthly function invocations. You are charged based on the tier to which the accumulative number of monthly function invocations belongs.

Tier

Number of invocations

Unit price

0

(0, 1 billion]

USD 0.0015 per 10,000 invocations

1

(1 billion, 10 billion]

USD 0.0012 per 10,000 invocations

2

(10 billion, 50 billion]

USD 0.0008 per 10,000 invocations

3

> 50 billion

USD 0.0003 per 10,000 invocations

vCPU usage

Billing formulas

You can specify vCPU specifications for function instances based on your business requirements. vCPU usage in Function Compute is billed in the tiered pricing mode. Bills are generated on an hourly basis based on accumulative monthly vCPU usage. You are charged based on the tier to which the accumulative monthly vCPU usage belongs.

Note

Billing of vCPU usage is based on the vCPU specifications that you configure for your functions, not based on the actual vCPUs consumed during function executions.

  • vCPU usage = vCPUs for function instances × Execution duration (seconds)

  • Fee of vCPU usage = Tier 0 vCPU usage × Tier 0 unit price + Tier 1 vCPU usage × Tier 1 unit price + Tier 2 vCPU usage × Tier 2 unit price + Tier 3 vCPU usage × Tier 3 unit price

Unit prices

  • vCPU usage for instances in the active state

    Tier

    vCPU usage (vCPU-second)

    Unit price

    0

    (0, 30 million]

    USD 0.000015/vCPU-second

    1

    (30 million, 150 million]

    USD 0.000012/vCPU-second

    2

    (150 million, 1 billion]

    USD 0.000009/vCPU-second

    3

    > 1 billion

    USD 0.000006/vCPU-second

  • vCPU usage for instances in the idle state: The unit price is USD 0/vCPU-second.

GPU usage

Billing formulas

You can specify GPU specifications for function instances based on your business requirements. GPU usage in Function Compute is billed in the tiered pricing mode. Bills are generated on an hourly basis based on accumulative monthly GPU usage. You are charged based on the tier to which the accumulative monthly GPU usage belongs.

Note

Billing of GPU usage is based on the GPU specifications that you configure for your functions, not based on the actual GPU resources consumed during function executions.

  • GPU usage = GPU capacity (GB) of function instances × Execution duration (seconds)

  • Fee of GPU usage = Tier 0 GPU usage × Tier 0 unit price + Tier 1 GPU usage × Tier 1 unit price + Tier 2 GPU usage × Tier 2 unit price + Tier 3 GPU usage × Tier 3 unit price

Unit prices

  • GPU usage for instances in the active state

    Tier

    GPU usage (GB-second)

    Unit price

    0

    (0, 30 million]

    USD 0.000018/GB-second

    1

    (30 million, 150 million]

    USD 0.000015/GB-second

    2

    (150 million, 600 million]

    USD 0.000012/GB-second

    3

    > 600 million

    USD 0.000009/GB-second

  • GPU usage for instances in the idle state

    To use the idle mode feature, your GPU function must be configured with 16 GB (T4) or 24 GB (A10) of GPU cards. You can join the DingTalk group 11721331 and request to use the idle mode.

Memory usage

Billing formulas

You can specify memory sizes for instances based on your business requirements. The following formula is used to calculate fees of memory usage.

Note

Billing of memory usage is based on the memory size that you configure for your function, not based on the actual memory consumed during function executions.

Fee of memory usage = Memory size for function instances (GB)× Execution duration (seconds) × Unit price

Unit prices

The unit price for memory usage is USD 0.0000015/GB-second.

Disk usage

Billing formulas

Note

Billing of disk usage is based on the disk sizes that you configure for your functions, not based on the actual disk capacity consumed during function executions.

Fee of disk usage = Disk size (GB) of function instances × Execution duration (s) × Unit price

Unit prices

  • Disk size ≤ 512 MB: free of charge.

  • Disk size > 512 MB: You are charged for the capacity that exceeds 512 MB at USD 0.00000015/GB-second.

Outbound Internet traffic

Description

Note
  • Starting from 00:00 on January 5, 2024, CDT is used to bill outbound Internet traffic of Function Compute. You are charged for Internet traffic based on the billing rules of CDT. For more information, see Products and metering methods supported by CDT.

  • From 00:00 on April 8, 2024, you are provided with a free quota of 200 GB of Internet data transfers over Border Gateway Protocol (BGP) lines each month. 20 GB of the quota can be used to offset Internet data transfers in all regions, inside and outside the Chinese mainland. The remaining 180 GB can only be used to offset Internet data transfers used in regions outside the Chinese mainland. The free quota can be used to offset outbound Internet data transfers of the eight Alibaba Cloud services, including Function Compute, that are supported by CDT. For more information, see [Product changes] Quota change of free Internet traffic.

In Function Compute, you are charged based on total outbound Internet traffic. Fees for outbound Internet traffic = (Internet traffic within a function + Traffic for responses to requests + CDN origin traffic) × Unit traffic price.

  • Internet traffic within a function: the traffic that is generated when a function sends requests over the Internet.

  • Traffic for responses to requests: the traffic that is generated when a function returns responses over the Internet after the function is executed.

  • CDN origin traffic: the traffic that is generated when a function in Function Compute is used as the origin of Alibaba Cloud CDN.

Note
  • Traffic over the internal network is free of charge.

  • Inbound Internet traffic is free of charge. Examples of inbound Internet traffic: the traffic that is generated to receive the data that is returned after a function initiates a request over the Internet, and the traffic that is generated when a client sends a request to invoke a function.

  • The billing granularity for outbound Internet traffic is KB. The total amount of outbound Internet traffic per month is rounded to two decimal places.

Unit prices

The tiered pricing mode is supported to bill outbound Internet traffic after CDT is used to bill outbound Internet traffic of Function Compute.

Price tier

Chinese mainland

Asia Pacific

Europe

North America

Middle East and South America

0-200 GB

  • Global regions (including regions in the Chinese mainland): a free quota of 20 GB

  • Regions outside the Chinese mainland: a free quota of 180 GB

0-10 TB (including 10 TB)

0.118 USD/GB

0.100 USD/GB

0.074 USD/GB

0.074 USD/GB

0.116 USD/GB

10-50 TB (including 50 TB)

0.111 USD/GB

0.070 USD/GB

0.065 USD/GB

0.065 USD/GB

0.110 USD/GB

50-150 TB (including 150 TB)

0.103 USD/GB

0.065 USD/GB

0.060 USD/GB

0.060 USD/GB

0.091 USD/GB

150 TB and more

0.096 USD/GB

0.055 USD/GB

0.040 USD/GB

0.040 USD/GB

0.065 USD/GB

Billing examples

Billing example for number of function invocations

Time

Number of function invocations

Fee

2023.11.01 00:00:00 - 01:00:00

5 billion

Fee of the number of function invocations = Tier 0 unit price × Tier 0 invocations + Tier 1 unit price × Tier 1 invocations = USD 0.0015/10,000 invocations × 1,000,000,000 invocations + USD 0.0012/10,000 invocations × 4,000,000,000 invocations = USD 630

2023.11.01 01:00:00 - 02:00:00

6 billion

Fee of the number of function invocations = Tier 1 unit price × Tier 1 invocations + Tier 2 unit price × Tier 2 invocations = USD 0.0012/10,000 invocations × 5,000,000,000 invocations + USD 0.0008/10,000 invocations × 1,000,000,000 invocations = USD 680

2023.11.01 02:00:00 - 03:00:00

7 billion

Fee of the number of function invocations = Tier 2 unit price × Tier 2 invocations = USD 0.0008/10,000 invocations × 7,000,000,000 invocations = USD 560

Billing example of vCPU usage

Assume that your function is configured with 2 vCPUs. The following table lists the number of invocations and the corresponding fees for vCPU usage. In this example, the execution duration is 1 second.

Time

Number of invocations

Fee of vCPU usage

2023.11.01 00:00:00 - 01:00:00

10 million

  • vCPU usage = Number of vCPUs × Execution duration = 2 vCPUs × 10,000,000 invocations × 1 second/invocation = 20,000,000 vCPU-seconds

  • Fee of vCPU usage = Tier 0 unit price × Tier 0 vCPU usage = USD 0.000015/vCPU-second × 20,000,000 vCPU-seconds = USD 300

2023.11.01 01:00:00 - 02:00:00

20 million

  • vCPU usage = Number of vCPUs × Execution duration = 2 vCPUs × 20,000,000 invocations × 1 second/invocation = 40,000,000 vCPU-seconds.

  • Fee of vCPU usage = Tier 0 unit price × Tier 0 vCPU usage + Tier 1 unit price × Tier 1 vCPU usage = USD 0.000015/vCPU-second × 10,000,000 vCPU-seconds + USD 0.000012/vCPU-second × 30,000,000 vCPU-seconds = USD 510

2023.11.01 02:00:00 - 03:00:00

20 million

  • vCPU usage = Number of vCPUs × Execution duration = 2 vCPUs × 20,000,000 invocations × 1 second/invocation = 40,000,000 vCPU-seconds.

  • Fee of vCPU usage = Tier 1 unit price × Tier 1 vCPU usage = USD 0.000012/vCPU-second × 40,000,000 vCPU-seconds = USD 480

Billing example of GPU usage

Assume that your GPU function is configured with 4,096 MB of GPU memory. The execution duration of the instance is 1 second per invocation. The following table lists fees for GPU usage of instances in the active state in different periods of time.

Time

Number of invocations

Fee of GPU usage for instances in the active state

2023.11.01 00:00:00 - 01:00:00

10 million

  • GPU usage = GPU memory x Execution duration = 4 GB × 10,000,000 invocations × 1 second/invocation = 40,000,000 GB-seconds.

  • Fee of GPU usage = Tier 0 unit price × Tier 0 GPU usage + Tier 1 unit price × Tier 1 GPU usage = USD 0.000018/GB-second × 30,000,000 GB-seconds + USD 0.000015/GB-second × 10,000,000 GB-seconds = USD 690

2023.11.01 01:00:00 - 02:00:00

20 million

  • GPU usage = GPU memory × Execution duration = 4 GB × 20,000,000 invocations × 1 second/invocation = 80,000,000 GB-seconds.

  • Fee of GPU usage = Tier 1 unit price × Tier 1 GPU usage = USD 0.000015/GB-second × 80,000,000 GB-seconds = USD 1,200

2023.11.01 02:00:00 - 03:00:00

20 million

  • GPU usage = GPU memory × Execution duration = 4 GB × 20,000,000 invocations × 1 second/invocation = 80,000,000 GB-seconds.

  • Fee of GPU usage = Tier 1 unit price × Tier 1 GPU usage + Tier 2 unit price × Tier 2 GPU usage = USD 0.000015/GB-second × 30,000,000 GB-seconds + USD 0.000012/GB-second × 50,000,000 GB-seconds = USD 1,050

Billing example of memory usage

Assume that your function is configured with 16 GB of memory, the number of invocations is 10 million, and the execution duration is 1 second per invocation. The following formula is used to calculate the fee of memory usage:

Fee of memory usage = Memory usage × Unit price of memory price = 16 GB ×(10,000,000 invocations × 1 second/invocation) × USD 0.0000015/GB-second = USD 240

Billing example of disk usage

Assume that your function is configured with 10 GB of disk size, the number of invocations is 10 million, and the execution duration is 1 second per invocation. The following formula is used to calculate the fee of disk usage:

Fee of disk usage = Disk size × Execution duration × Unit price of disk usage = (10 GB - 512 MB) × (10,000,000 invocations × 1 second/invocation) × USD 0.00000015/GB-second = USD 14.25

Billing example of outbound Internet traffic

降价后示例-INTL ZH.png

Reduce costs by using the instance concurrency feature

Alibaba Cloud Function Compute supports the instance concurrency feature. You can reduce costs if you reuse resources to process multiple requests. For more information, see Configure instance concurrency.

For example, you want to process 1 million requests, each of which is processed in 1 second. The following table compares fees of different instance concurrency. In this example, fees for memory usage is used as an example.

Concurrency mode

Fee for 1 million requests

Instance concurrency = 1

Fee for memory usage: 1,000,000 invocations × 1 second/invocation × USD 0.0000015/GB-second = USD 1.5

Instance concurrency > 1

If the instance concurrency is set to 10, the following formula is used to calculate fees of memory usage:

Fee for memory usage: 1,000,000 invocations × 1 second/10 invocations × USD 0.0000015/GB-second = USD 0.15.

FAQ