Updated on 2023-11-15 GMT+08:00

Configuring Basic Settings

Introduction

After a function is created, Memory (MB), Handler, and Execution Timeout (s) are automatically set based on your runtime. If needed, modify them based on this section.

Prerequisites

You have created a function.

Procedure

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Basic Settings and configure parameters based on Table 1. Parameters marked with an asterisk (*) are mandatory.
    Table 1 Basic settings

    Parameter

    Description

    App

    After a function is created, it is automatically categorized into the default app and cannot be switched to other apps.

    NOTICE:

    An app acts like a folder. In the future, functions will be managed by label for better experience.

    *Handler

    • For a Node.js, Python, or PHP function, the handler must be named in the format of [file name].[function name], which must contain a period (.).

      Example: myfunction.handler

    • For a Java function, the handler must be named in the format of [package name].[class name].[execution function name].

      Example: com.xxxxx.exp.Myfunction.myHandler

    • For a Go function, the handler name must be the same as the executable file name in the uploaded code package.

      Example: If the executable file is handler, set this parameter to handler.

    • For a C# function, the handler must be named in the format of [assembly]::[namespace].[class name]::[execution function name].

      Example: HelloCsharp::Example.Hello::Handler

    *Enterprise Project

    Select a created enterprise project and add the function to it. By default, default is selected.

    NOTE:

    If EPS is not enabled, this parameter is unavailable. For details, see Enabling the Enterprise Project Function.

    *Execution Timeout (s)

    Maximum duration the function can be executed. You can set this parameter on the Configuration tab page. If the execution takes longer than 90s, use asynchronous invocation.

    The value ranges from 3s to 259,200s.

    NOTE:

    The maximum duration for returning a result is 90s. If both the set timeout and the actual execution duration of a function exceed 90s, a message is displayed indicating that the function has timed out. However, the backend is still running. You can view the return result on the Logs tab page.

    Memory (MB)

    Memory of a function instance. Options: 128, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584, 4096, 8192, 10,240.

    Description

    Description of the function, which cannot exceed 512 characters.

  4. Click Save.