This topic describes the instance types, free monthly quota, billable items, unit prices, and benefits of Function Compute and provides examples on how Function Compute is billed.
Function Compute provides the following instance types:
- Flexible instance: the basic instance type of Function Compute. The maximum package size for a flexible instance is 50 MB. The execution duration of functions by a flexible instance is up to 900 seconds.
- Performance instance: an instance type that has higher specifications. Function Compute provides multiple specifications with higher resource limits for performance instances. Therefore, performance instances are applicable to more scenarios than flexible instances.
For more information, see Instance specifications and usage modes.
Free monthly quota
Function Compute provides you with the free monthly quota. Your Alibaba Cloud account and RAM users share the free monthly quota of requests and execution duration of functions. The free monthly quota does not accumulate. At 00:00:00 on the first day of each calendar month, the free quota is cleared and recalculated. The following resources are included in the free monthly quota:
- Requests: The first one million requests each month are free of charge.
- Resources for function executions: The first 400,000 GB-s of resources used by instances each month are free of charge.
Billable items and unit prices
Unit price: USD 0.2 per 1,000,000 requests
- Computing power of instances: The computing power of an instance is proportional to the memory size allocated to the instance. To simplify the billing model, Function Compute uses the memory size of an instance to indicate the computing power of the instance.
- Execution duration: Instances can be used in provisioned or on-demand mode. The execution duration of functions by provisioned instances and that by on-demand instances are measured in different ways. For more information, see Instance specifications and usage modes.
- Function Compute provides computing capabilities that match those of Elastic Compute Service (ECS) and Container Service for Kubernetes. You do not need to worry about the computing power of instances.
- Function Compute allows you to concurrently process requests by using a single instance. Reused resources are billed based on the amount of resources that are used and are not repeatedly billed for each reuse.
- Subscription: Purchase a specific number of resource coupons based on the estimated
requirements before you use Function Compute.
Unit price: USD 12.16 per GB per month. This is the monthly fee for an instance that has 1 GB of computing power.
- Pay-as-you-go: Pay for the resources that are used.
Unit price: USD 0.000016384 per GB per second. This is the fee for an instance that has 1 GB of computing power to execute requests for 1 second.
- When you purchase resource coupons, no instances are created.
- Resource coupons can be used to offset the fees for both provisioned and on-demand instances. If Function Compute fails to deliver the resources that you purchased due to insufficient underlying computing resources, you can be reimbursed for the fees for the undelivered resources. We recommend that you create provisioned instances and purchase resource coupons to offset the fees for the instances.
- For more information about how to minimize the costs in subscription mode, see Best practices of minimizing Function Compute costs.
- Traffic within a function: the traffic generated when the function sends requests
to the Internet.
Unit price: USD 0.117 per GB
- Traffic for responses to requests: the traffic generated when the function sends responses
Unit price: USD 0.117 per GB
- CDN back-to-origin traffic: the traffic generated when the function is used as the
origin of Alibaba Cloud CDN.
Unit price: USD 0.117 per GB
- Traffic over the internal network is free of charge.
- Inbound Internet traffic is free of charge. For example, you are not charged when functions in Function Compute read or download files from the Internet. However, you are charged for the traffic generated when functions write files to storage objects on the Internet.
The following table describes how to calculate the monthly fee for a pay-as-you-go instance.
|Memory size||Number of requests||Execution duration per request||Network bandwidth||Monthly fee|
|512 MB||3 million||1 second||0||USD 18.4224 = (512 MB/1024 × 3,000,000 × 1 second - 400,000 GB-s) × USD 0.000016384/GB-s + (3,000,000 - 1,000,000) × USD 0.2/1,000,000|
|128 MB||30 million||200 milliseconds||0||USD 11.5344 = (128 MB/1024 × 30,000,000 × 0.2 seconds - 400,000 GB-s) × USD 0.000016384/GB-s + (30,000,000 - 1,000,000) × USD 0.2/1,000,000|
|128 MB||25 million||200 milliseconds||0||USD 8.4864 = (128 MB/1024 × 25,000,000 × 0.2 seconds - 400,000 GB-s) × USD 0.000016384/GB-s + (25,000,000 - 1,000,000) × USD 0.2/1,000,000|
|448 MB||5 million||500 milliseconds||0||USD 12.1664 = (448 MB/1024 × 5,000,000 × 0.5 seconds - 400,000 GB-s) × USD 0.000016384/GB-s + (5,000,000 - 1,000,000) × USD 0.2/1,000,000|
|1024 MB||2.5 million||1 second||0||USD 34.7064 = (1024 MB/1024 × 2,500,000 × 1 second - 400,000 GB-s) × USD 0.000016384/GB-s + (2,500,000 - 1,000,000) × USD 0.2/1,000,000|
Function Compute allows you to concurrently process requests by using a single instance and charges you for the resource usage of the instance. You can reduce costs by reusing resources to process a large number of requests.
|Usage mode||Fee for 1,000,000 requests|
|A single instance that processes a single request at a time||Resource usage fee = 1,000,000 × 1 second × USD 0.000016384/GB-s= USD 16.384|
|A single instance that concurrently processes multiple requests||Assume that the instance can concurrently process 10 requests.
Resource usage fee = 1,000,000 × 1 second/10 × USD 0.000016384/GB-s = USD 1.6384
For the detailed billing information, see the following topics: