This topic describes the instance types, free monthly tier, billable items, unit prices, and benefits of Function Compute and provides examples on how Function Compute is billed.

Instance types

Function Compute provides the following instance types:

  • Flexible instance: the basic instance type of Function Compute. The maximum package size of a flexible instance is 50 MB. Functions in a flexible instance can run for up to900 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 tier

Function Compute provides you with the free monthly tier. Your Alibaba Cloud account and RAM users share the quota of requests and function duration included in your free monthly tier. Your free monthly tier does not accumulate. At 00:00:00 on the first day of each calendar month, your free tier is cleared and recalculated. The following resources are included in the free monthly tier.

Notice The free monthly tier can be used only for pay-as-you-go flexible instances.
  • Requests: The first one million requests each month are free of charge.
  • Function duration: The first 400,000 CU-second of resources used by function instances each month are free of charge.

Billable items and unit prices

Function invocation fees = Number of requests x Unit price per request
Unit price: USD 0.2/1,000,000 requests
Cost for resource usage of function instances = Computing power of function instances × Function duration × Unit price for resource usage
  • Computing power of function instances: The computing power of a function instance is proportionate to the memory size allocated for the instance. To simplify the billing model, Function Compute uses the memory size of an function instance to indicate the computing power of the instance.
  • Function duration: Function instances can be used in the reserved or pay-as-you-go mode. The function duration of reserved instances and pay-as-you-go instances are measured in different ways. For more information, see Instance specifications.

Note:
  • Function Compute provides computing capabilities that match those of Elastic Compute Service (ECS) and Alibaba Cloud Container Service for Kubernetes. You do not need to worry about the computing power of function instances.
  • Function Compute supports concurrent requests in a single instance. Reused resources are billed based on the amount of resources and are not repeatedly billed for each reuse.
Unit price
The resource usage of function instances is billed in the following two methods:
  • Subscription: Purchase a specific number of resource coupons based on the estimated requirements before you use Function Compute.
    Unit price: USD 12.16/GB-month. This is the monthly cost for an function instance that has 1 GB of computing power.
  • Pay-as-you-go: Pay for the resources that are used.
    Unit price: USD 0.000016384/GB-second. This is the cost for an function instance that has 1 GB of computing power to run for one second.

Note:
  • When you purchase resource coupons, no instances are created.
  • Resource coupons can be used to deduct the cost of both reserved and pay-as-you-go function instances. If Function Compute fails to deliver the resources that you purchased due to insufficient underlying computing resources, you can be reimbursed for the costs of the undelivered resources. We recommend that you create reserved function instances and purchase resource coupons to deduct the costs of the instances.
  • For more information about how to minimize the costs, see Best practices of minimizing Function Compute costs.
Cost of outbound Internet traffic = Traffic within a function × Traffic unit price + Traffic for responses to requests × Traffic unit price + CDN back-to-origin traffic × Traffic unit price
  • Traffic within a function: the traffic generated when the function sends requests to Internet.
    Unit price: USD 0.117/GB
  • Traffic for responses to request: the traffic generated when the function sends responses to requests.
    Unit price: USD 0.117/GB
  • CDN back-to-origin traffic: the traffic generated when the function is used as the origin of Cloud Delivery Network (CDN).
    Unit price: USD 0.117/GB

Note:
  • Traffic over the internal network is free of charge.
  • Inbound Internet traffic is free of charge. For example, you are not billed when functions in Function Compute read or download files from the Internet. However, the traffic generated when functions write files to storage on the Internet is billed.
  • From June 9, 2020, the unit prices of traffic for responses to request and CDN back-to-origin traffic are reduced from USD 0.187/GB to USD 0.117/GB.
If you use other Alibaba Cloud services together with your functions, additional fees are charged for these services. For example, if you use a function to write data to an Object Storage Service (OSS) bucket or activate Log Service to store the logs of your functions, additional fees for OSS or Log Service are charged.

Billing examples

The following example shows how to calculate the monthly cost of an pay-as-you-go function instance.

Memory Number of requests Function duration per request Network bandwidth Monthly cost
512 MB 3 million 1 second 0 USD 18.4224 = (512 MB/1024 × 3,000,000 × 1 second - 400,000 CU-second) × USD 0.000016384/CU-second + (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 CU-second) × USD 0.000016384/CU-second + (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 CU-second) × USD 0.000016384/CU-second + (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 CU-second) × USD 0.000016384/CU-second + (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 CU-second) × USD 0.000016384/CU-second + (2,500,000 - 1,000,000) × USD 0.2/1,000,000

Billing information

For the detailed billing information, see the following topics: