配置
配置作参数
Redis 堆栈 | Redis 社区版 | Redis 企业软件 | Redis 云 | Redis 社区版 | 适用于 Kubernetes 的 Redis Enterprise | 客户 |
---|
Redis Stack 的触发器和函数功能提供了配置选项来控制其作。这些选项可以在引导模块时设置,在某些情况下,还可以在运行时设置。
以下部分介绍配置选项及其设置方法。
Bootstrap 配置
您可以在加载模块时设置配置选项。
在启动时加载模块时,可以在 Redis 配置文件中定义模块配置。在运行时加载模块时,可以将配置赋予MODULE LOADEX
命令。每个配置都必须以模块名称redisgears_2.<configuration name>
.
运行时配置
您可以在运行时设置某些配置选项。在运行时设置配置是使用CONFIG SET
命令。这里每个配置都必须以模块名称redisgears_2.<configuration name>
.
例:
> 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
On this page