This topic describes the billing of Function Compute, including the billing methods, billable items, and provides billing examples.
Function Compute supports the following billing methods.
Function Compute provides a free trial quota for the first-time users of Function Compute. The Alibaba Cloud account shares the trial quota with RAM users. The following items provide the details of the trial quota.
- vCPU: 500,000 vCPU-seconds
- Memory: 1 million GB-seconds
- Requests: 1 million
- The trial quota is valid for one year.
- The trial quota does not cover GPU usage and outbound Internet traffic. If you do not purchase resource plans, you are charged for the GPU usage and outbound Internet traffic based on the pay-as-you-go billing method. The disk usage that exceeds 512 MB is also billed on the pay-as-you-go basis.
Function Compute provides the following types of resource plans: vCPU resource plans, memory resource plans, GPU resource plans, function invocation plans, and outbound Internet data transfer plans. You can use these resource plans to offset fees of the corresponding billable item. For more information, see Billable items. If your resource plan has a remaining quota, the resource plan is preferentially used to offset the fees for resource usage. After the quota in your resource plan is exhausted, the pay-as-you-go billing method is used for the resources that cannot be offset.
Resource plans allow you to use the same amount of resources at more favorable prices. This helps you reduce the costs. For more information, see Resource plans.
You are charged for the computing resources that you use. For more information, see Pay-as-you-go billing method.
The billable items of Function Compute include the number of function requests, resource usage, and outbound Internet traffic.
Number of function requests
In Function Compute, you are charged based on the total number of function requests per month. Fees for function requests = Number of requests x Unit price
|Billable item||Unit price|
|Number of requests||USD 0.002 per 10,000 requests|
- Fees for vCPU usage = vCPU used by instances × Execution duration (s) × Unit price
- Fees for memory usage = Memory used by instances (GB) × Execution duration (s) × Unit price
- Computing power of instances: The computing power of an instance is proportional to the number of vCPUs and the memory size. To simplify the billing, Function Compute uses the number of vCPUs or the memory size (GB) of an instance to indicate the computing power of the instance. For example, an instance with 2 vCPUs has twice the computing power of an instance with 1 vCPU, and an instance with 2 GB of memory has twice the computing power of an instance with 1 GB of memory.
- Execution duration: Function Compute supports provisioned and on-demand instances. The execution durations of provisioned instances and on-demand instances are measured by using different methods. For more information, see Instance types and instance modes.
1 vCPU-seconds means that an instance with 1 vCPU runs 1 second, or an instance with 0.5 vCPU runs 2 seconds, and so on.
1 GB-seconds means that an instance with 1 GB of memory runs 1 second, or an instance with 512 MB of memory runs 2 seconds, and so on.
- Active instances
Instances that are processing requests or for which Idle Billing is turned off are active instances.
- Idle instances
The provisioned instances for which Idle Billing is turned on and not processing requests are idle instances.
Unit prices for each billable item
|Billable item||Unit price|
|Active vCPU||USD 0.00002138/vCPU-seconds|
|Idle vCPU||USD 0.000002138/vCPU-seconds|
Outbound Internet traffic
- Traffic within a function: the traffic that is generated when the 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 back-to-origin traffic: the traffic that is generated when Function Compute is used as the origin for Alibaba Cloud CDN (CDN).
|Billable item||Unit price|
|Outbound Internet traffic||USD 0.117/GB|
- Traffic over the internal network is free of charge.
- Inbound Internet traffic is free of charge. Examples: the traffic that is generated when data is returned after the request that is initiated by a function 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 1 KB. The total billable amount of outbound Internet traffic used per month is rounded to two decimal places.
The following table describes an example on how to calculate the monthly fees for a pay-as-you-go instance. In this example, the outbound Internet traffic is 0 KB.
|vCPU||CPU memory||GPU memory||Number of requests||Execution duration per request||Monthly fees|
|2||8192 MB||4096 MB||1 million requests||1 second per request||USD 480.06
Reduce costs with high instance concurrency
Alibaba Cloud Function Compute supports multiple concurrency of an instance. You can reduce costs when you reuse resources to process a large number of requests. For more information, see Configure instance concurrency.
|Usage mode||Fee for 1 million requests|
|A single instance that processes a single request||
Memory usage fee = 1,000,000 × 1 second × USD 0.00000238/GB-seconds = USD 2.38
|A single instance that concurrently processes multiple requests||If the concurrency for a single instance is 10,
Memory usage fee = 1,000,000 × 1 second/10 × USD 0.00000238/GB-seconds = USD 0.238