Skip to main content

Environment Variable

Built-in environment

variable namedescription
NOSLATE_PATHNoslate installation directory, generally used when introducing SDK
NOSLATE_WORKDIRNoslate working directory, such as: code package, instance configuration, etc.
NOSLATE_BINNoslate execution directory, including: turf, data_plane, control_plane, aworker, etc.
NOSLATE_LOGDIRNoslate log directory

Specify system configuration with environment variables

variable namedescription
NOSLATED_CONFIG_PATHNoslated configuration file path
NOSLATED_VIRTUAL_MEMORY_POOL_SIZEVirtual memory pool size
NOSLATED_RESERVATION_WORKER_COUNT_PER_FUNCTIONThe default reservation limit of each Worker function instance
NOSLATED_REPLICA_COUNT_LIMIT_PER_FUNCTIONDefault limit for each Worker function instance
NOSLATED_MAX_ACTIVATE_REQUESTSThe default maximum number of simultaneous requests per Worker function
NOSLATED_WORKER_SHRINK_REDUNDANT_TIMESThe redundant interval of shrink

Specify the environment variables available to the working instance

The environment variables used by the default Worker instance are isolated from the environment variables in the system to prevent pollution and control the reading range. If there are environment variables in the system that need to be accessed by the Worker instance, you can set a whitelist.

The SDK provides the setPlatformEnvironmentVariables method for setting the whitelist:

await agent.setPlatformEnvironmentVariables([
{
key: 'NODE_ENV',
value: 'production'
}
]);