content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Configuration.md
Redis Stack's triggers and functions feature provides configuration options to control its operation. These options can be set when the module is bootstrapped and, in some cases, at runtime.
The following sections describe the configuration options and how to set them.
You can set your configuration options when the module is loaded.
When the module is loaded at start time, the module configuration can be defined in the Redis configuration file. When loading the module at runtime the configuration can be given to the [MODULE LOADEX]({{< relref "/commands/module-loadex" >}}) command. Each configuration must be prefixed with the module name, redisgears_2.<configuration name>.
You may set certain configuration options at runtime. Setting a configuration at runtime is done using [CONFIG SET]({{< relref "/commands/config-set" >}}) command. Here each configuration must be prefixed with the module name, redisgears_2.<configuration name>.
Example:
> config set redisgears_2.lock-redis-timeout 1000
OK
The execution-threads configuration option controls the number of background threads that run JS code. Note that libraries are considered single threaded. This configuration allows Redis to parallelize the invocation of multiple libraries.
Expected Value
Integer
Default
1
Minimum Value
1
Maximum Value
32
Runtime Configurability
No
The library-fatal-failure-policy configuration option controls how to handle a fatal error. A fatal error is consider one of the following:
This configuration basically allows choosing between two options:
Expected Value
Default
abort
Runtime Configurability
Yes
The v8-maxmemory configuration option controls the maximum amount of memory used by all V8 libraries. Exceeding this limit is considered a fatal error and will be handled base on the library-fatal-failure-policy configuration value.
Expected Value
Integer
Default
200M
Minimum Value
50M
Maximum Value
1G
Runtime Configurability
No
The v8-library-initial-memory-usage configuration option controls the initial memory given to a single V8 library. This value can not be greater then v8-library-initial-memory-limit or v8-maxmemory.
Expected Value
Integer
Default
2M
Minimum Value
1M
Maximum Value
10M
Runtime Configurability
No
The v8-library-initial-memory-limit configuration option controls the initial memory limit on a single V8 library. This value can not be greater then v8-maxmemory.
Expected Value
Integer
Default
3M
Minimum Value
2M
Maximum Value
20M
Runtime Configurability
No
The v8-library-memory-usage-delta configuration option controls the delta by which we will increase the V8 library memory limit once the limit reached. This value can not be greater then v8-maxmemory.
Expected Value
Integer
Default
1M
Minimum Value
1M
Maximum Value
10M
Runtime Configurability
No
The lock-redis-timeout configuration option controls the maximum amount of time (in MS) a library can lock Redis. Exceeding this limit is considered a fatal error and will be handled based on the library-fatal-failure-policy configuration value. This
configuration only affects library loading at runtime with TFUNCTION LOAD.
The timeout for loading a library from RDB is set separately via
db-loading-lock-redis-timeout.
Expected Value
Integer
Default
500 MS
Minimum Value
100 MS
Maximum Value
Unlimited
Runtime Configurability
Yes
When setting lock-redis-timeout, if the new value is higher than the
db-loading-lock-redis-timeout, the db-loading-lock-redis-timeout is also updated to
this value.
This timeout configuration is used for setting the upper time limit (in milliseconds) for the library loading from RDB.
Expected Value
Integer
Default
30000 MS
Minimum Value
100 MS
Maximum Value
Unlimited
Runtime Configurability
Yes
The value cannot be lower than the value of lock-redis-timeout.
The remote-task-default-timeout configuration option controls the timeout when waiting for a remote task to finish. If the timeout is reached an error will result.
Expected Value
Integer
Default
500 MS
Minimum Value
1 MS
Maximum Value
Unlimited
Runtime Configurability
Yes
The error-verbosity configuration option controls the verbosity of error messages that will be provided by triggers and functions. The higher the value the more verbose the error messages will be (for example, including stack traces and extra information for better analysis and debugging).
Expected Value
Integer
Default
1
Minimum Value
1
Maximum Value
2
Runtime Configurability
Yes