配置参数
RedisBloom 支持多个模块配置参数。所有这些参数只能在加载时设置。
在模块加载时设置配置参数
在加载时设置配置参数是通过在--loadmodule
参数,当从命令行启动服务器时或在loadmodule
指令。例如:
在 redis.conf 中:
loadmodule ./redisbloom.so [OPT VAL]...
From the Redis CLI, using the MODULE LOAD command:
127.0.0.6379> MODULE LOAD redisbloom.so [OPT VAL]...
From the command line:
$ redis-server --loadmodule ./redisbloom.so [OPT VAL]...
RedisBloom configuration parameters
The following table summarizes which configuration parameters can be set at module load-time and which can be set on run-time:
Configuration Parameter
Load-time
Run-time
ERROR_RATE
✅
⬜
INITIAL_SIZE
✅
⬜
CF_MAX_EXPANSIONS
✅
⬜
Default parameters
!!! warning "Note on using initialization default sizes"
A filter should always be sized for the expected capacity and the desired error-rate.
Using the INSERT
family commands with the default values should be used in cases where many small filter exist and the expectation is most will remain at about that size.
Not optimizing a filter for its intended use will result in degradation of performance and memory efficiency.
ERROR_RATE
Default error ratio for Bloom filters.
Default
0.01
Example
$ redis-server --loadmodule /path/to/redisbloom.so ERROR_RATE 0.004
INITIAL_SIZE
Default initial capacity for Bloom filters.
Default
100
Example
$ redis-server --loadmodule /path/to/redisbloom.so INITIAL_SIZE 400
CF_MAX_EXPANSIONS
Default maximum expansions for Cuckoo filters.
Default
32
Example
$ redis-server --loadmodule /path/to/redisbloom.so CF_MAX_EXPANSIONS 16
On this page