Configuration

Configure the operation parameters

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.

Bootstrap configuration

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 command. Each configuration must be prefixed with the module name, redisgears_2.<configuration name>.

Runtime configuration

You may set certain configuration options at runtime. Setting a configuration at runtime is done using 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

Configurations

execution-threads

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

library-fatal-failure-policy

The library-fatal-failure-policy configuration option controls how to handle a fatal error. A fatal error is consider one of the following:

  • Block timeout - The function blocks the Redis processes for too long (configurable using the lock-redis-timeout configuration value)
  • OOM - The function consumes too much memory (configurable using the v8-maxmemory configuration value).

This configuration basically allows choosing between two options:

  • Do not break atomicity property, even at the cost of killing the Redis processes.
  • Keep my Redis processes alive, even at the cost of losing atomicity.

Expected Value

  • kill - Save the atomicity property. Risk of killing the Redis processes.
  • abort - Abort the invocation of the function and keep the Redis processes alive. Risk of losing the atomicity property.

Default

abort

Runtime Configurability

Yes

v8-maxmemory

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

v8-library-initial-memory-usage

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

v8-library-initial-memory-limit

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

v8-library-memory-usage-delta

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

lock-redis-timeout

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

Side effects

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.

db-loading-lock-redis-timeout

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

Notes

The value cannot be lower than the value of lock-redis-timeout.

remote-task-default-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

error-verbosity

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

Rate this page