Function Compute provides performance instances and flexible instances. This topic describes these two types of instances, including their background, usage notes, specifications, features, and billing methods.

Background

Function execution needs instances. Limits on existing resources affect the use of Function Compute in some scenarios, as shown in the following examples:
  • Limits on duration: The duration of a function cannot be longer than 600 seconds, so lengthy offline tasks cannot be run.
  • Limits on disk and package sizes: Large applications cannot be smoothly migrated to Function Compute.

Beginning in August 2020, function resources can use instances with larger specifications, known as performance instances. These instances alleviate the effect of these limits and support more specific resource sizes and more scenarios.

In Function Compute, instances of the new type are called performance instances and instances of the original type are called flexible instances. For more information, see Instance specifications.

You can specify the instance type and specifications when you create a function. For more information, see Create a function. You can also update the instance type and specifications of a function. For more information, see Modify a function. You can select Performance Instance as the instance type to execute your function on an instance with higher computing power.

Usage notes

  • Prerequisites for using performance instances

    You must create a virtual private cloud (VPC) before you can use performance instances. If you want to create a VPC, contact us.

  • Limits on switching an instance type

    An error may occur to a function when you switch the instance type without a proper risk assessment. To avoid such an error, you can switch the instance type only from Flexible Instance to Performance Instance when you configure a function.

  • Combination of instance types for reduced cold start time
    Performance instances scale out slowly and have poor auto scaling compared with flexible instances. In scenarios that require long function duration, high CPU resource commitment, fast cold start time, and low costs, you can use a combination of performance instances, multiple requests, resource reservation, and subscriptions.
    • Performance instances: resolve duration and package size limits and specify CPU resources.
    • Multiple requests: use the same instance based on well-defined CPU and memory capacity, resulting in lower costs.
    • Reserved resources: resolve issues related to cold start.
    • Subscriptions: deduct from instance resources reserved for a long time. This billing method reduces costs by 70%.
  • Cold start feedback for performance instances
    Cold start problems may occur in scenarios, such as sparse invocations or increasing load, which require scaling. A cold start takes hundreds of milliseconds on flexible instances, whereas it takes dozens of seconds to minutes on performance instances. Long cold start times may cause the system to fail to respond in a timely manner. To resolve this issue, the system notifies you the status of function instances within a short period of time.invoke response

Instance specifications

  • Performance instances

    Performance instances can have the following instance specifications. You can choose instances with different specifications to meet your needs.

    Memory (GB) CPU (C) Package size (MB) Function duration (s) Disk size (GB) Bandwidth (Gbit/s)
    4 2 500 7200 10 1
    8 4 500 7200 10 1.5
    16 8 500 7200 10 2.5
  • Flexible instances
    Memory (MB) Maximum package size (MB) Maximum function duration (s) Disk size (MB)
    128~3072 50 600 512

Supported modes

Performance instances and flexible instances support the following modes:

Billing method

The same billing method is used for performance instances and flexible instances. For more information, see Overview.

More information