All Products
Search
Document Center

Function Compute:Instance types and usage modes

Last Updated:Oct 21, 2023

Function Compute provides elastic instances and GPU-accelerated instances. This topic describes the types, specifications, usage notes, and usage modes of the instances.

Instance types

  • Elastic instance: The basic type of instance provided by Function Compute. Elastic instances are suitable for scenarios in which traffic spikes occur and compute-intensive scenarios.

  • GPU-accelerated instance: Instances that use the Ampere and Turing architectures for GPU acceleration. In most cases, GPU-accelerated instances are used in scenarios such as audio and video processing, AI, and image processing. Instances of this type accelerate business by offloading loads to GPU hardware.

    The following topics describe the best practices for GPU-accelerated instances in different scenarios:

    Important
    • GPU-accelerated instances can be deployed only by using container images.

    • For optimal user experience, join the DingTalk group 11721331 and provide the following information:

      • Your organization name, such as your company name.

      • The ID of your Alibaba Cloud account.

      • The region where you want to use GPU-accelerated instances. Example: China (Shenzhen).

      • Your contact information, such as your mobile number, email address, or DingTalk account.

Instance specifications

  • Elastic instances

    The following table describes the specifications of elastic instances. You can select instance specifications based on your business requirements.

    vCPU (core)

    Memory size (MB)

    Maximum code package size (GB)

    Maximum function execution duration (seconds)

    Maximum disk size (GB)

    Maximum bandwidth (Gbit/s)

    Valid values: 0.05 to 16

    Note: The value must be a multiple of 0.05.

    Valid values: 128 to 32768

    Note: The value must be a multiple of 64.

    10

    86400

    10

    Valid values:

    • 512 MB. This is the default value.

    • 10 GB.

    5

    Note

    The ratio of vCPU capacity to memory capacity (in GB) ranges from 1:1 to 1:4.

  • GPU-accelerated instances

    The following table describes the specifications of GPU-accelerated instances. You can select instance specifications based on your business requirements.

    Instance specification

    Card type

    vGPU memory (MB)

    vGPU computing power (card)

    vCPU (core)

    Memory size (MB)

    fc.gpu.tesla.1

    Tesla T4

    Valid values: 1024 to 16384 (1 GB to 16 GB)

    Note: The value must be a multiple of 1024.

    The value is calculated based on the following formula: vGPU computing power = vGPU memory (GB)/16. For example, if you set the vGPU memory to 5 GB, the maximum vGPU computing power is 5/16.

    Note: Computing resources are automatically allocated by Function Compute. You do not need to manually allocate computing resources.

    Valid values: 0.05 to the value of [vGPU memory (GB)/2].

    Note: The value must be a multiple of 0.05. For more information, see GPU specifications.

    Valid values: 128 to the value of [vGPU memory (GB) x 2048].

    Note: The value must be a multiple of 64. For more information, see GPU specifications.

    fc.gpu.ampere.1

    Ampere A10

    Valid values: 1024 to 24576 (1 GB to 24 GB)

    Note: The value must be a multiple of 1024.

    The value is calculated based on the following formula: vGPU computing power = vGPU memory (GB)/24. For example, if you set the vGPU memory to 5 GB, the maximum vGPU computing power is 5/24.

    Note: Computing resources are automatically allocated by Function Compute. You do not need to manually allocate computing resources.

    Valid values: 0.05 to the value of [vGPU memory (GB)/3].

    Note: The value must be a multiple of 0.05. For more information, see GPU specifications.

    Valid values: 128 to the value of [vGPU memory (GB) x 4096)/3].

    Note: The value must be a multiple of 64. For more information, see GPU specifications.

    The GPU-accelerated instances of Function Compute also support the following resource specifications.

    Image size (GB)

    Maximum function execution duration (seconds)

    Maximum disk size (GB)

    Maximum bandwidth (Gbit/s)

    Container Registry Enterprise Edition (Standard Edition): 10

    Container Registry Enterprise Edition (Advanced Edition): 10

    Container Registry Enterprise Edition (Basic Edition): 10

    Container Registry Personal Edition (free): 10

    86400

    10

    5

    Note
    • Specifying the instance type as g1 achieves the same effect as selecting the fc.gpu.tesla.1 instance specification.

    • GPU-accelerated instances of the T4 type are supported in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), China (Zhangjiakou), China (Shenzhen), Japan (Tokyo), US (Virginia), and Singapore.

    • GPU-accelerated instances of the A10 type are supported in the following regions: China (Hangzhou), China (Shanghai), Japan (Tokyo), and Singapore.

GPU specifications

Expand to view the details of the fc.gpu.tesla.1 instance specification.

vGPU memory (MB)

vCPU (core)

Maximum memory size (GB)

Memory size (MB)

1024

Valid values: 0.05 to 0.5

2

Valid values: 128 to 2048

2048

Valid values: 0.05 to 1

4

Valid values: 128 to 4096

3072

Valid values: 0.05 to 1.5

6

Valid values: 128 to 6144

4096

Valid values: 0.05 to 2

8

Valid values: 128 to 8192

5120

Valid values: 0.05 to 2.5

10

Valid values: 128 to 10240

6144

Valid values: 0.05 to 3

12

Valid values: 128 to 12288

7168

Valid values: 0.05 to 3.5

14

Valid values: 128 to 14336

8192

Valid values: 0.05 to 4

16

Valid values: 128 to 16384

9216

Valid values: 0.05 to 4.5

18

Valid values: 128 to 18432

10240

Valid values: 0.05 to 5

20

Valid values: 128 to 20480

11264

Valid values: 0.05 to 5.5

22

Valid values: 128 to 22528

12288

Valid values: 0.05 to 6

24

Valid values: 128 to 24576

13312

Valid values: 0.05 to 6.5

26

Valid values: 128 to 26624

14336

Valid values: 0.05 to 7

28

Valid values: 128 to 28672

15360

Valid values: 0.05 to 7.5

30

Valid values: 128 to 30720

16384

Valid values: 0.05 to 8

32

Valid values: 128 to 32768

Expand to view the details of the fc.gpu.ampere.1 instance specification.

vGPU memory (MB)

vCPU (core)

Maximum memory size (GB)

Memory size (MB)

1024

Valid values: 0.05 to 0.3

1.3125

Valid values: 128 to 1344

2048

Valid values: 0.05 to 0.65

2.625

Valid values: 128 to 2688

3072

Valid values: 0.05 to 1

4

Valid values: 128 to 4096

4096

Valid values: 0.05 to 1.3

5.3125

Valid values: 128 to 5440

5120

Valid values: 0.05 to 1.65

6.625

Valid values: 128 to 6784

6144

Valid values: 0.05 to 2

8

Valid values: 128 to 8192

7168

Valid values: 0.05 to 2.3

9.3125

Valid values: 128 to 9536

8192

Valid values: 0.05 to 2.65

10.625

Valid values: 128 to 10880

9216

Valid values: 0.05 to 3

12

Valid values: 128 to 12288

10240

Valid values: 0.05 to 3.3

13.3125

Valid values: 128 to 13632

11264

Valid values: 0.05 to 3.65

14.625

Valid values: 128 to 14976

12288

Valid values: 0.05 to 4

16

Valid values: 128 to 16384

13312

Valid values: 0.05 to 4.3

17.3125

Valid values: 128 to 17728

14336

Valid values: 0.05 to 4.65

18.625

Valid values: 128 to 19072

15360

Valid values: 0.05 to 5

20

Valid values: 128 to 20480

16384

Valid values: 0.05 to 5.3

21.3125

Valid values: 128 to 21824

17408

Valid values: 0.05 to 5.65

22.625

Valid values: 128 to 23168

18432

Valid values: 0.05 to 6

24

Valid values: 128 to 24576

19456

Valid values: 0.05 to 6.3

25.3125

Valid values: 128 to 25920

20480

Valid values: 0.05 to 6.65

26.625

Valid values: 128 to 27264

21504

Valid values: 0.05 to 7

28

Valid values: 128 to 28672

22528

Valid values: 0.05 to 7.3

29.3125

Valid values: 128 to 30016

23552

Valid values: 0.05 to 7.65

30.625

Valid values: 128 to 31360

24576

Valid values: 0.05 to 8

32

Valid values: 128 to 32768

Usage notes

If you want to reduce the cold start duration or improve resource utilization, you can use the following solutions:

  • Provisioned mode: the ideal solution to resolve the cold start issue. In this mode, you can reserve a fixed number of instances based on your resource budget, reserve resources for a specific period of time based on business fluctuation, or select an auto scaling policy based on usage thresholds. After the provisioned mode is used, the average cold start latency of instances is reduced.

  • High concurrency for a single instance: the ideal solution to improve resource utilization of instances. We recommend that you configure a high concurrency for instances based on the resource demands of your business. If you use this solution, the CPU and memory are preemptively shared when multiple tasks are executed on one instance at the same time. This way, resource utilization is improved.

Usage modes

GPU-accelerated instances and elastic instances support the following usage modes.

On-demand mode

In on-demand mode, Function Compute automatically allocates and releases instances for functions. In this mode, the billed execution duration starts from the time when a request is sent to execute a function and ends at the time when the request is completely executed. An on-demand instance can process one or more requests at a time. For more information, see Configure instance concurrency.

  • Execution duration of functions by a single instance that processes a single request at a time

    When an on-demand instance processes a single request, the billed execution duration starts from the time when the request arrives at the instance and ends at the time when the request is completely executed.instanceconcurrency=1

  • Execution duration of functions by a single instance that concurrently processes multiple requests at a time

    If you use an on-demand instance to concurrently process multiple requests, the billed execution duration starts from the time when the first request arrives at the instance and ends at the time when the last request is completely executed. You can reuse resources to concurrently process multiple requests. This way, resource costs can be reduced.

    instanceconcurrency />1

Provisioned mode

In provisioned mode, function instances are allocated, released, and managed by yourself. For more information, see Configure provisioned instances and auto scaling rules. In provisioned mode, the billed execution duration starts from the time when Function Compute starts a provisioned instance and ends at the time when you release the instance. You are charged for the instance until you release the instance, regardless of whether the provisioned instance executes requests.On-Demand Resources

Additional information