All Products
Search
Document Center

Function Compute (2.0):Billing overview

Last Updated:Jul 10, 2024

Function Compute supports the following billing methods: trial quotas, 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, and function invocation quota. 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 for corresponding billable items. Resource plans are preferentially used to offset fees for resource usage. If 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 tiered pricing mode.

Resource usage

Active GPU usage

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

vCPU usage

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

Idle GPU usage

You are charged based on the GPU specifications that you configure for your functions and the total idle duration.

Pay-as-you-go

Memory usage

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

Disk usage

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.

Basic concepts

  • Idle mode: Function Compute supports the idle mode feature. After the idle mode feature is enabled, elastic instances and GPU-accelerated instances in Function Compute are classified into active and idle instances based on whether they are processing requests. For more information, see Idle mode.

    • Active instances: Instances that are processing requests.

    • Idle instance: Instances that are not processing requests after the idle mode feature is enabled.

  • 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 provisioned instances and 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 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 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 for 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

  • Unit prices for active vCPU usage

    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

  • Unit price for idle vCPU usage: USD 0/vCPU-second.

Active GPU Usage

Billing formulas

You can specify GPU specifications for function instances based on your business requirements. Active GPU usage in Function Compute is billed in 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.

  • Active GPU usage = GPUs for function instances (GB)× Execution duration (seconds)

  • Fee for active 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

  • Unit prices for active GPU usage

    Tier

    GPU usage (CU)

    Unit price

    0

    (0, 30 million]

    USD 0.000018/CU

    1

    (30 million, 150 million]

    USD 0.000015/CU

    2

    (150 million, 600 million]

    USD 0.000012/CU

    3

    > 600 million

    USD 0.000009/CU

Mapping of GPU compute units

In Function Compute, GPU-accelerated instances are powered by Tesla T4 or Ampere A10 GPU cards. The following table shows the mapping of the compute units.

GPU card type

CU

GB-second

Tesla T4

1

1

Ampere A10

1

1

Idle GPU Usage

Billing formulas

To use the idle mode feature, your GPU function must be configured with 16 GB (Tesla T4) or 24 GB (Ampere A10) of GPU cards. If you want to use this feature, submit a ticket or join the DingTalk group 64970014484 for technical support.

Idle GPU usage = Function instance GPU (GB)× Idle duration (seconds)

Unit prices

Unit price for idle GPU usage: USD 0.000007/CU

Mapping of GPU compute units

In Function Compute, GPU-accelerated instances are powered by Tesla T4 or Ampere A10 GPU cards. The following table shows the mapping of the compute units.

GPU card type

CU

GB-second

Tesla T4

1

1

Ampere A10

1

1

Memory usage

Billing formulas

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

Note

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

Fee for 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 for 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 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 1 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 for 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 for 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 for 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 per invocation.

Time

Number of invocations

Fee for vCPU usage

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

10,000.000

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

  • Fee for 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,000,000

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

  • Fee for 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,000,000

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

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

Billing example for active 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 for active GPU usage

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

10,000,000

  • Usage = GPU specification × Execution duration = 4 GB × 10,000,000 invocations × 1 second/invocation = 40,000,000 CUs

  • Fee = Tier 0 unit price × Tier 0 GPU usage + Tier 1 unit price × Tier 1 usage = USD 0.000018/CU × 30,000,000 CUs + USD 0.000015/CU × 10,000,000 CUs = USD 690

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

20,000,000

  • Usage = GPU specification × Execution duration = 4 GB × 20,000,000 invocations × 1 second/invocation = 80,000,000 CUs

  • Fee = Tier 1 unit price × Tier 1 usage = USD 0.000015/CU × 80,000,000 CUs = USD 1,200

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

20,000,000

  • Usage = GPU specification × Execution duration = 4 GB × 20,000,000 invocations × 1 second/invocation = 80,000,000 CUs

  • Fee = Tier 1 unit price × Tier 1 usage + Tier 2 unit price × Tier 2 usage = USD 0.000015/CU × 30,000,000 CUs + USD 0.000012/CU × 50,000,000 CUs = USD 1,050

Mapping of GPU compute units

In Function Compute, GPU-accelerated instances are powered by Tesla T4 or Ampere A10 GPU cards. The following table shows the mapping of the compute units.

GPU card type

CU

GB-second

Tesla T4

1

1

Ampere A10

1

1

Billing example for idle GPU usage

Assume that you have deployed a Stable Diffusion application whose GPU specification is 24 GB (Ampere A10) and specify to reserve GPU instances for 1 hour. During this period, the GPU function is invoked for 1,800 times and the execution duration for each invocation is 1 second. If the idle mode is enabled, you are charged based on the active GPU usage and idle GPU usage. The active GPU usage fee is calculated based on the active duration, specifically, 1,800 seconds (1,800 invocations x 1 seconds/invocation). The idle GPU usage fee is calculated based on the idle duration, which is also 1,800 seconds.

Time

Execution duration

Fee for idle GPU usage

2024.06.14 00:00:00 - 01:00:00

3,600 seconds

  • Active GPU usage = GPU specification × Execution duration = 24 GB × 1,800 seconds = 43,200 CUs

  • Idle GPU usage = GPU specification × Idle duration = 24 GB × 1,800 seconds = 43,200 CUs

  • Fee = Tier 0 unit price × Active GPU usage + Idle GPU price × Idle GPU usage = USD 0.000018/CU × 43,200 CUs + USD 0.000007/CU × 43,200 CUs = USD 1.08

Mapping of GPU compute units

In Function Compute, GPU-accelerated instances are powered by Tesla T4 or Ampere A10 GPU cards. The following table shows the mapping of the compute units.

GPU card type

CU

GB-second

Tesla T4

1

1

Ampere A10

1

1

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 for memory usage:

Fee for 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 for disk usage:

Fee for 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 for different instance concurrency. In this example, memory usage fees are 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 for memory usage:

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

FAQ