Configure Function Memory

Configure Command

Catalyst enables you to configure the memory for each of your functions. This memory will be allocated when the function is executed. You can choose a memory between 128 MB to 512 MB for any function.

The default memory assigned to a function is 256 MB. That is, if you don’t configure the memory, or if you had created a function before this feature was made available, the memory would be set to 256 MB automatically.

Note: The CPU is allocated automatically based on the memory you configure for your function. You won't be able to view or configure this value.

You can modify this value for any of your existing functions as per your requirements in the following way:

  1. Execute the following command from your function’s project directory.
copy
$
catalyst functions:config

The CLI will list all the functions you have created in your project, along with information of their current memory allocation.

  1. Select one of the functions to configure, and press Enter .
    Configure Function Memory in CLI

  2. Select the memory to allocate to the function from the available options, and press Enter .
    Configure Function Memory in CLI

    The memory configuration for the function will be updated.
    Configure Function Memory in CLI


You can also directly configure a function’s memory by specifying the function’s name or ID along with the command like:

copy
$
catalyst functions:config[function_name_or_id]

For example:

copy
$
catalyst functions:config Generate_Invoice

The CLI will then ask you to select a memory configuration in the same manner.

Configure Function Memory Options

You can also directly specify the memory you want allocated for a specific function using the
--memory <value> option for the catalyst functions:config command, followed by the function’s name or ID.

This can be done in the following way:

copy
$
catalyst functions:config [--memory <value>] [function_name_or_id]

For example, if you want to allocate 128 MB memory for a function named MailOrder , then execute the following command:

copy
$
catalyst functions:config --memory 128MB MailOrder

The CLI will ask you for confirmation. Enter Y and press Enter .

The memory configuration for the function will be updated.

Last Updated 2023-03-17 22:50:25 +0530 +0530