To meet the requirements of different scenarios, Function Compute provides built-in runtimes, custom runtimes, and Custom Container runtimes. This topic describes the applicable scenarios and differences of the function runtimes that Function Compute supports to help you make a technical selection.
Comparison
|
Feature |
Built-in runtime |
Custom runtime |
Custom Container runtime |
|
Use cases |
Write code to process an event and an HTTP request using the interfaces defined by Function Compute. |
Build applications with popular frameworks such as Java SpringBoot, Node.js Express, Python Flask, and Golang Gin, or migrate existing ones. |
|
|
Cold start |
Fastest. The code package does not include the runtime, which enables the fastest cold start. |
Faster. A custom runtime uses a public base image, which eliminates image pull time, enabling a faster cold start. |
Slower. The runtime must pull the container image, which causes a slower cold start. |
|
Code package limit |
500 MB for an uncompressed code package |
500 MB for an uncompressed code package |
10 GB for an uncompressed image |
|
Code package format |
ZIP, JAR (Java), or a folder |
ZIP, JAR (Java), or a folder |
|
|
Gpu-accelerated instance support |
Not supported |
Not supported |
Supported |
|
Runtimes |
Node.js, Python, PHP, Java, .NET Core, and Go |
Unlimited |
Unlimited |
Function runtimes
Built-in runtime
Choose a built-in runtime if you want to write code that processes an event and an HTTP request using the interfaces defined by Function Compute. For more information, see Create a function.
The Create Function page offers three options: Use Built-in Runtime, Use Custom Runtime, and Use Container Image.
Custom runtime
Choose a custom runtime to build applications with popular frameworks such as Java SpringBoot, Node.js Express, Python Flask, or Golang Gin, or to migrate existing ones. For more information, see Create a function.
In the Runtime drop-down list, available custom runtimes include .NET 6.0, TypeScript, Rust, Ruby, Dart, and Deno.
Custom Container runtime
Alibaba Cloud Container Registry (ACR) is a platform for the secure hosting and efficient distribution of cloud-native artifacts that comply with the OCI standard, such as container images and Helm Charts. When you deploy functions by using container images, you can use a secure and efficient cloud-based image hosting and distribution service without having to build and maintain your own. For more information, see Create a Custom Container function.
On the Create Function page, select Use Container Image. Then, expand and configure the Basic Settings, Image Settings, Advanced Settings, Environment Variables, and Trigger Settings sections as needed. Finally, click Create.