All Products
Search
Document Center

Function Compute:Terms

Last Updated:Jan 29, 2026

This topic describes the key terms for the Function Compute function creation process. For more information about how to create a function, see Use event functions to process events from Alibaba Cloud services.

FC function creation process

A Function Compute (FC) function is the basic unit for resource scheduling and execution in Function Compute. An FC function consists of function code and a function configuration. The following figure shows the concepts related to the function creation process.

image

Create a function

When you create a function, you can select a function type and a corresponding runtime environment. Then, you can upload your function code to Function Compute. You can configure other parameters later as needed.

  • Technical selection guide

    • Event function

      You can select an event trigger, such as an OSS trigger, a Kafka trigger, or an SLS trigger. You can write your program based on the interfaces defined by Function Compute. For more information, see Create an event-triggered function.

    • Web function

      You can select a popular web framework, such as Flask, ThinkPHP, Express, or SpringBoot. You can write your program based on the interfaces defined by the framework. For more information, see Create a web function.

    • Task function

      You can select the task mode to process asynchronous requests. The status of each task is tracked, and you can manually start or stop the task. This mode is recommended for offline scenarios, such as scheduled tasks, audio and video processing, and data processing. For more information, see Create a task function.

    • GPU function

      You can select a popular AI project, such as Stable Diffusion WebUI, ComfyUI, RAG, or TensorRT. We recommend that you deploy these projects to Function Compute as images. For more information, see Create a GPU-accelerated function.

  • Runtime environment

    • Built-in runtime

      A predefined runtime is a runtime environment predefined by the Function Compute platform. You must write the request handler based on the interfaces defined by Function Compute. A predefined runtime does not support multiple concurrent requests per instance, but it offers the fastest cold starts. This runtime is suitable for event-triggered scenarios that use OSS, Kafka, or SLS triggers. For more information, see Function Compute runtimes.

      • Event (event)

        Event data is passed to your function as a JSON document. The runtime converts the event into an object and passes it to the event parameter of the function handler. If the event is generated by another Alibaba Cloud service, the event format depends on that service. For more information, see Trigger event formats.

      • Context (context)

        When Function Compute runs your function, it passes a context object to the context parameter of the function handler. This object contains information about the invocation, service, function, and execution environment. For more information, see Context.

    • Custom runtime

      A custom runtime supports mainstream web frameworks such as Flask, ThinkPHP, Express, and SpringBoot. You only need to write your program based on the interfaces defined by the framework. For a custom runtime, the ZIP package of your code file is an HTTP Server program. You can simply set the Start Command and Start Arguments in the function configuration to start the HTTP Server. For more information, see How it works.

    • Custom image

      Function Compute provides the custom image feature, which lets you use container images as the delivery artifact for functions. You can upload a custom image to ACR and then use the image, or you can use a sample image. For more information, see Create a function that uses a custom image.

      In Function Compute, only custom images support the creation of GPU functions.

  • Provisioned instance

    After you purchase a provisioned resource pool, you can bind it to a GPU function when you create the function. Then, you can allocate provisioned instances to process requests.

    Provisioned resource pools are available only for GPU functions and use a monthly subscription billing method. This method helps you reserve scarce GPU resources in advance to ensure stable business operations and prevent disruptions from resource shortages.

  • Elastic instance

    An elastic instance is an instance that Function Compute automatically scales based on the number of function invocations. Function Compute creates instances when the number of invocations increases and destroys instances when the number of requests decreases. During this process, requests automatically trigger the creation of instances. The first invocation must wait for the instance to cold start.

  • Elastic instance (light hibernation (formerly idle))

    If you set the minimum instance count to 1 or higher, we recommend that you enable the light hibernation (formerly idle) mode. In this mode, when an instance is idle and has no requests, the system automatically freezes some of its resources. You are charged only a minimal keep-alive fee. When a request arrives, the instance becomes active. The resources that were frozen during light hibernation are quickly restored. The hot start process typically takes more than 2 seconds, depending on the model size.

    Elastic instances in the following scenarios automatically enter the elastic instance (light hibernation (formerly idle)) billing state:

    • An elastic instance is idle after you set the minimum instance count to 1 or higher and enable the light hibernation (formerly idle) switch.

    • An elastic instance is in its keep-alive period in a session affinity scenario.

    • An elastic instance is not processing background tasks in a background task scenario.

  • Elastic instance (active)

    Elastic instances in the following scenarios automatically enter the elastic instance (active) billing state:

    • An elastic instance is automatically started by requests when the minimum instance count is not set (defaults to scaling down to 0).

    • An elastic instance becomes active to handle requests after you set the minimum instance count to 1 or higher, regardless of whether the light hibernation (formerly idle) switch is enabled.

    • An elastic instance is processing requests in a session affinity scenario.

    • An elastic instance is processing background tasks in a background task scenario.

  • Minimum instance count

    Setting the minimum instance count to 1 or higher helps resolve the cold start issue for the first request that is handled by an elastic instance. It also lets you reserve elastic resources to guarantee delivery. For services that strongly rely on session affinity, such as WebSocket and gRPC, setting the minimum instance count to 1 or higher enables session affinity scheduling and persistent connections, which ensures the stability of real-time interactions.

    You can also configure scheduled and metric-based scaling to dynamically adjust the minimum instance count. The system can increase the minimum instance count during specified time periods or when a metric reaches a specific threshold to handle peak loads. It can then decrease the minimum instance count when the load drops to a specified value to maximize resource utilization. For more information, see Instance scaling limits and elastic policies.

Configure a function

After you create a function, you may need to adjust the following configuration items as needed.

  • Basic configurations

    • Instance type

      Function Compute provides various function instance types. You can choose different specifications as needed. For more information, see Instance types.

    • Temporary disk

      Each function instance provides a temporary storage disk that is mounted to the instance's root directory. The data on this disk is automatically cleared when the instance is reclaimed. For file system persistence, we recommend that you use storage solutions such as configuring a NAS file system or configuring an OSS file system. This ensures that data is retained after system restarts or failures and can be easily managed and scaled.

      Note

      For full-card Function Compute GPU instance types (16 GB for the Tesla series and 48 GB for the Ada series), you can configure a disk size of 30 GB or 60 GB. Other instance types support only disk sizes of 512 MB or 10 GB. The 512 MB disk size is free of charge.

  • Trigger

    Some Alibaba Cloud services can directly invoke FC functions using triggers. These services push events to Function Compute and invoke the function immediately when a specific event occurs. For more information, see Introduction to triggers.

    You can configure multiple triggers for a single function. Each trigger can act as an independent client to invoke your function. Each event that Function Compute passes to your function contains data from only one trigger. Function Compute converts the event document into an object and passes that object to the function handler.

  • Runtime

    Function Compute supports multiple languages using runtimes. A runtime provides a language-specific environment that runs in an execution environment. The runtime relays invocation events, context information, and responses between Function Compute and the function. For more information, see Introduction to runtimes.

  • Environment variable

    Environment variables are stored as string key-value pairs as part of the function configuration. Different functions have independent environment variables. You can use environment variables to adjust the behavior of your function without updating its code. For more information, see Configure environment variables.

  • Layer

    A layer is a .zip file that can contain additional code or other content. A layer typically contains libraries, a custom runtime, data, or configuration files. Function Compute provides an official public layer that you can use and also supports creating custom layers. Using layers provides the following benefits:

    • Reduce the size of deployment packages.

      Placing all function dependencies in a layer helps reduce the size of the function code deployment package and speeds up code deployment.

    • Separate core function logic from dependencies.

      Layers allow you to update function dependencies without updating the function code, and vice versa. This helps separate the two and lets you focus on your function logic.

    • Share dependencies across multiple functions.

      You can place common functions or dependencies in a layer and add the layer to any number of functions in your account. Without layers, you would need to include the same dependencies in each deployment package.

    Note

    Functions that use a custom image (Custom Container) do not support adding layers. You can package your preferred runtime, libraries, and other dependencies into the container image when you create a function that uses a custom image.

  • Permissions

    You can configure permissions for a function by setting a function role. The Function Compute platform uses this RAM role to generate temporary keys for accessing your Alibaba Cloud resources and passes them to your code. For more information, see Use a function role to grant a function permissions to access other Alibaba Cloud services.

  • Logs

    Function Compute integrates with Simple Log Service (SLS). After you configure logging for a function, Function Compute automatically collects logs and delivers them to the specified Logstore. For more information, see Configure the logging feature.

  • Network

    By default, a function can access the internet but cannot access resources within a VPC. If you need the function to access resources in a VPC or allow a specified VPC to invoke the function, you must manually configure the network and permissions for that function. For more information, see Configure network settings.

  • Storage

    Function Compute supports mounting NAS file systems and OSS. For more information, see Configure a NAS file system and Configure OSS access.

  • Asynchronous configuration

    Function Compute supports executing asynchronous requests in task mode. In task mode, the Function Compute system records the execution status of each of your tasks at various stages. It provides features such as task status queries, task queue metrics, task deduplication, and proactive task termination. Asynchronous tasks are suitable for long-running tasks. If your asynchronous request processing is latency-sensitive, requires response times of less than 100 milliseconds, or to continuously submit thousands or more tasks per second, task mode is not suitable. For more information, see Asynchronous invocation.

  • Lifecycle

    Function instances are dynamically created or destroyed based on the real-time request volume. The lifecycle of each function instance includes three stages: Creating, Invoke, and Destroy. For more information, see Configure an instance lifecycle hook.

  • Health check

    Function Compute supports periodic health checks for Web function and GPU function instances. This feature prevents requests from being allocated to abnormal instances, which helps prevent request failures. For more information, see Configure a health check for an instance.

  • DNS

    The custom DNS feature is suitable for scenarios such as accelerating site access and supports only predefined runtimes and custom runtimes. For more information, see Configure custom DNS.

  • Custom domain name

    You can bind a custom domain name to a function or application to access the function or application through a fixed domain name. You can also use the configured custom domain name as an origin domain name and add a CDN-accelerated domain name for it. This configuration allows your users to retrieve content faster, which reduces access latency and improves service quality. For more information, see Configure a custom domain name.

Invoke a function

After you deploy an FC function, you can invoke it in multiple ways. For example, you can quickly create a test event in the Function Compute console to invoke the function, use an SDK to invoke the function, call an API to invoke the function directly, use a function URL HTTP or HTTPS endpoint, or trigger it from an event source. The following sections describe concepts related to function invocation.

  • Synchronous call

    The result is returned immediately after the function processes the event. For more information, see Synchronous invocations.

  • Asynchronous call

    A response is returned immediately after the event is successfully triggered, without waiting for the background task to complete. The Function Compute system reliably processes the message but does not return the specific invocation details or function execution status. If you want to obtain the result of an asynchronous call, you must configure an asynchronous invocation destination. For more information, see Feature overview.

  • Invocation analysis

    The invocation analysis feature provides a summary of the execution status at the request level. After you enable this feature, the system collects metric information for each function execution. For more information, see Request-level metric logs.

  • Maximum instance count

    This parameter specifies the maximum number of instances for the current function. The default maximum instance count for an Alibaba Cloud account in a single region is 100. The actual value is subject to the quota displayed in Quota Center. To increase this limit, go to Quota Center to submit an application.

  • Concurrency per instance

    Concurrency per instance refers to the number of requests that a single function instance can process simultaneously. When you create a function using a custom runtime or a container image, you can configure multiple concurrent requests per instance to reduce execution time and lower the total number of instances, which improves resource utilization. For more information, see Configure concurrency.

Other related concepts

  • Version

    Publishing a version saves the current code and configuration as an immutable baseline version. This baseline includes the function code and configuration but excludes resource properties such as triggers, asynchronous task configurations, and elastic policies. A version is similar to a Git commit. The commit contains one or more code file changes and their configurations, which represents a snapshot of the current repository. For more information, see Version management.

  • Alias

    An alias is a pointer to a specific function version. When you use an alias to access a function, Function Compute resolves the alias to the version to which it points. The caller does not need to know the specific version to which the alias points. You can use aliases to easily implement features such as publishing, rollbacks, and canary releases. An alias is similar to a Git tag. You can mark the current commit with a tag and then release it to mark a business iteration. For more information, see Alias management.

  • Tag

    You can use tags to categorize service resources to facilitate searching and resource aggregation. You can also use the tag feature to group services, which lets you grant different operational permissions to different roles for different service groups. For more information, see Configure tags.