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 quota
Function Compute provides trial quotas for users who activate Function Compute for the first time. The trial quotas include GPU quota, vCPU quota, memory quota, function invocation quota, and Cloud Data Transfer (CDT) Internet traffic quota. The validity period of the trial quotas is three months. You are charged for excess resource usage on the 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. After quotas in your resource plans are exhausted, you are charged on the 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 billing method.
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 |
The number of function invocations | The number of function invocations | The number of function invocations are billed in the tired pricing mode. |
| |
Resource usage | GPU | You are charged based on the GPU specification that you configure for your function. GPU usage is billed in the tiered pricing mode. |
| |
vCPU | You are charged based on the vCPU specification that you configure for your function. vCPU usage is billed in the tiered pricing mode. |
| ||
Memory | You are charged based on the memory size that you configure for your function. |
| ||
Disk | You are charged based on the disk specification that you configure for your function. | Pay-as-you-go | ||
Outbound Internet traffic | Outbound Internet traffic | You are charged based on 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 Supported products and metering methods. |
Billing units
The following units are used for 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 varies. 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.
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, you need to release the instances at the earliest opportunity. For more information, see Configure auto scaling rules.
The number of function invocations
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 that are initiated 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. This way, you are charged based on the tier to which the accumulative number of monthly function invocations belongs.
Tier | The 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.
Billing of vCPU usage is based on the vCPU specification that you configure for your function, not based on the actual vCPUs consumed during function executions.
vCPU usage = vCPUs for a function instance × 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 price
vCPU usage for active instances
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.
Billing of GPU usage is based on the GPU specification that you configure for your function, 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 price
Active GPU usage
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-accelerated instance must be configured with 16 GB (T4) or 24 GB (A10) of GPU. You can join the DingTalk group 11721331 to request to use the idle mode feature.
Memory usage
Billing formulas
You can specify the memory size for instances based on your business requirements. The following formula is used to calculate fees of memory usage:
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 price
The unit price for memory usage is USD 0.0000015/GB-second.
Disk usage
Billing formulas
Billing of disk usage is based on the disk size that you configure for your function, not based on the actual disk capacity consumed during function executions.
Fee of disk usage = Function instance disk size (GB) × Execution duration (s) × Unit price
Unit price
Disk size ≤ 512 MB: free of charge.
Disk size > 512 MB: You are charged for capacity that exceeds 512 MB at USD 0.00000015/GB-second.
Outbound Internet traffic
Description
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 billing rules of CDT. For more information, see Supported products and metering methods.
After the billing method is changed, you are provided with a free quota of 10 GB of Internet data transfers over Border Gateway Protocol (BGP) lines each month. The free quota can be used to offset outbound Internet data transfers of all Alibaba Cloud services that are supported by CDT in all regions. This free quota can be used together with other discounts. By default, the free quota is preferentially used. In addition, Function Compute also provides a free quota of outbound Internet traffic for new and existing users. For more information, see Free quota for new and existing users.
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 the function returns a response after the function is executed over the Internet.
CDN origin traffic: the traffic that is generated when the function in Function Compute is used as the origin of Alibaba Cloud CDN (CDN).
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 the 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 and North America | Middle East and South America |
0-20 GB | Free of charge | |||
0-10 TB (including 10 TB) | 0.118 USD/GB | 0.110 USD/GB | 0.074 USD/GB | 0.116 USD/GB |
10-50 TB (including 50 TB) | 0.111 USD/GB | 0.085 USD/GB | 0.072 USD/GB | 0.110 USD/GB |
50-150 TB (including 150 TB) | 0.103 USD/GB | 0.082 USD/GB | 0.070 USD/GB | 0.091 USD/GB |
150 TB and more | 0.096 USD/GB | 0.080 USD/GB | 0.050 USD/GB | 0.065 USD/GB |
Billing examples
Billing example for the number of function invocations
Time | The 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 two 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 | The number of invocations | Fee of vCPU usage |
2023.11.01 00:00:00 - 01:00:00 | 10 million |
|
2023.11.01 01:00:00 - 02:00:00 | 20 million |
|
2023.11.01 02:00:00 - 03:00:00 | 20 million |
|
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 describes the fees for GPU usage of active instances in different periods of time.
Time | The number of invocations | Fee of GPU usage for active instances |
2023.11.01 00:00:00 - 01:00:00 | 10 million |
|
2023.11.01 01:00:00 - 02:00:00 | 20 million |
|
2023.11.01 02:00:00 - 03:00:00 | 20 million |
|
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
Example: Your products accumulated 200 TB of Internet data transfers over BGP lines in the China (Shenzhen) region in May 2023. The fees are calculated by using the following formulas.
Price tier (TB) | Unit price of data transfers in the China (Shenzhen) region (USD/GB) | Fee (USD) |
0-20 GB | Free of charge | 0 |
0-10 TB (including 10 TB) | 0.118 | 10 × 1,024 × 0.118 = 1,208.32 |
10-50 TB (including 50 TB) | 0.111 | (50 - 10) × 1,024 × 0.111 = 4,546.56 |
50-150 TB (including 150 TB) | 0.103 | (150 - 50) × 1,024 × 0.103 = 10,547.2 |
150 TB and more | 0.096 | ((200 - 150) × 1024 - 20) × 0.096 = 4,913.28 |
200 TB of Internet data transfers reaches Tier 4, and the first 20 GB of Internet data transfers per month is free of charge. The fee in May 2023 is calculated by using the following formula: 10 × 1,024 × 0.118 + (50 - 10) × 1,024 × 0.111 + (150 - 50) × 1,024 × 0.103 + ((200 - 150) × 1024 - 20) × 0.096 = USD 21,215.36
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 |
A single instance processes a single request at a time | Fee for memory usage: 1,000,000 invocations × 1 second/invocation × USD 0.0000015/GB-second = USD 1.5 |
A single instance concurrently processes multiple requests at a time | If the concurrency for a single instance is 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. |