Skip to content

Commit

Permalink
DEV: CONFIG for modules changes for CE8
Browse files Browse the repository at this point in the history
  • Loading branch information
dwdougherty committed Dec 5, 2024
1 parent c39ae61 commit 43a231d
Show file tree
Hide file tree
Showing 13 changed files with 849 additions and 861 deletions.
8 changes: 5 additions & 3 deletions content/commands/ft.config-get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ categories:
command_flags:
- readonly
complexity: O(1)
deprecated_since: 8.0.0
description: Retrieves runtime configuration options
doc_flags:
- deprecated
group: search
hidden: false
linkTitle: FT.CONFIG GET
module: Search
replaced_by: '[`CONFIG GET`]({{< relref "/commands/config-get" >}})'
since: 1.0.0
stack_path: docs/interact/search-and-query
summary: Retrieves runtime configuration options
syntax: 'FT.CONFIG GET option
'
syntax: FT.CONFIG GET option
syntax_fmt: FT.CONFIG GET option
syntax_str: ''
title: FT.CONFIG GET
Expand Down
10 changes: 6 additions & 4 deletions content/commands/ft.config-set/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ categories:
- kubernetes
- clients
complexity: O(1)
deprecated_since: 8.0.0
description: Sets runtime configuration options
doc_flags:
- deprecated
group: search
hidden: false
linkTitle: FT.CONFIG SET
module: Search
replaced_by: '[`CONFIG SET`]({{< relref "/commands/config-set" >}})'
since: 1.0.0
stack_path: docs/interact/search-and-query
summary: Sets runtime configuration options
syntax: 'FT.CONFIG SET option value
'
syntax: FT.CONFIG SET option value
syntax_fmt: FT.CONFIG SET option value
syntax_str: value
title: FT.CONFIG SET
Expand All @@ -35,7 +37,7 @@ Set the value of a RediSearch configuration parameter.

Values set using `FT.CONFIG SET` are not persisted after server restart.

RediSearch configuration parameters are detailed in [Configuration parameters]({{< relref "/develop/interact/search-and-query/basic-constructs/configuration-parameters" >}}).
RediSearch configuration parameters are detailed in [Configuration parameters]({{< relref "/develop/interact/search-and-query/administration/configuration" >}}).

{{% alert title="Note" color="warning" %}}
As detailed in the link above, not all RediSearch configuration parameters can be set at runtime.
Expand Down
4 changes: 4 additions & 0 deletions content/commands/module-load/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ unmodified to the module.

**Note**: modules can also be loaded at server startup with `loadmodule`
configuration directive in `redis.conf`.

{{< note >}}
As of Redis CE v8.0.0, loading a module via the Redis CLI with configuration parameters is deprecated.
{{< /note >}}
169 changes: 117 additions & 52 deletions content/develop/data-types/probabilistic/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,93 +9,158 @@ categories:
- oss
- kubernetes
- clients
description: 'RedisBloom supports multiple module configuration parameters. All of
these parameters can only be set at load-time.
'
description: Redis probabilistic data structures support multiple configuration parameters.
linkTitle: Configuration
title: Configuration Parameters
weight: 100
---
{{< note >}}
As of Redis Community Edition 8.0, configuration parameters for the probabilistic data structures are now set in the following ways:
* At load time via your `redis.conf` file.
* At run time (where applicable) using the [`CONFIG SET`]({{< relref "/commands/config-set" >}}) command.
{{< /note >}}

## Setting configuration parameters on module load

Setting configuration parameters at load-time is done by appending arguments after the `--loadmodule` argument when starting a server from the command line or after the `loadmodule` directive in a Redis config file. For example:
## Redis probabilistic data structure configuration parameters

In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}):
The following table summarizes which Bloom filter configuration parameters can be set at run-time, and compatibility with Redis Enterprise and Redis Cloud

```sh
loadmodule ./redisbloom.so [OPT VAL]...
```
| Old parameter name | New parameter name | Run-time | Redis<br />Enterprise | Redis<br />Cloud |
| :------- | :------- | :------- | :------- | :------- |
| ERROR_RATE | [bf-error-rate](#bf-error-rate) | :white_check_mark: | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Not supported"><nobr>&#x274c; Free & Fixed</nobr></span> |
| | [bf-expansion-factor](#bf-expansion-factor) | :white_check_mark: |||
| INITIAL_SIZE | [bf-initial-size](#bf-initial-size) | :white_check_mark: | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Not supported"><nobr>&#x274c; Free & Fixed</nobr></span> |

From the [Redis CLI]({{< relref "/develop/tools/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command:
The following table summarizes which Cuckoo filter configuration parameters can be set at run-time, and compatibility with Redis Enterprise and Redis Cloud.

```
127.0.0.6379> MODULE LOAD redisbloom.so [OPT VAL]...
```
| Old parameter name | New parameter name | Run-time | Redis<br />Enterprise | Redis<br />Cloud |
| :------- | :------- | :------- | :------- | :------- |
| | [cf-bucket-size](#cf-bucket-size) | :white_check_mark: |||
| | [cf-initial-size](#cf-initial-size) | :white_check_mark: |||
| | [cf-expansion-factor](#cf-expansion-factor) | :white_check_mark: |||
| CF_MAX_EXPANSIONS | [cf-max-expansions](#cf-max-expansions) | :white_check_mark: | <span title="Supported">&#x2705; Supported</span><br /><span><br /></span> | <span title="Supported">&#x2705; Flexible & Annual</span><br /><span title="Not supported"><nobr>&#x274c; Free & Fixed</nobr></span> |
| | [cf-max-iterations](#cf-max-iterations) | :white_check_mark: |||

From the command line:
{{< warning >}}
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 filters exist and the expectation is most will remain at around the default sizes.
Not optimizing a filter for its intended use will result in degradation of performance and memory efficiency.
{{< /warning >}}

```sh
$ redis-server --loadmodule ./redisbloom.so [OPT VAL]...
```
## Default parameters for Bloom filters

## RedisBloom configuration parameters
### bf-error-rate

The following table summarizes which configuration parameters can be set at module load-time and which can be set on run-time:
Default error ratio for Bloom filters.

| Configuration Parameter | Load-time | Run-time |
| :------- | :----- | :----------- |
| [ERROR_RATE](#error_rate) | :white_check_mark: | :white_large_square: |
| [INITIAL_SIZE](#initial_size) | :white_check_mark: | :white_large_square: |
| [CF_MAX_EXPANSIONS](#cf_max_expansions) | :white_check_mark: | :white_large_square: |
Type: double

Valid range: `[0 .. 1]`; consider limiting the range to `[0 .. 0.25]`.

## Default parameters
Default: `0.01`

!!! 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.
### bf-expansion-factor

### ERROR_RATE
Added in v8.0.0.

Default error ratio for Bloom filters.
Expansion factor for Bloom filters.

#### Default
Type: integer

`0.01`
Valid range: `[0 .. 32768]`.

#### Example
Default: `2`

```
$ redis-server --loadmodule /path/to/redisbloom.so ERROR_RATE 0.004
```
### bf-initial-size

### INITIAL_SIZE
Initial capacity for Bloom filters.

Default initial capacity for Bloom filters.
Type: integer

#### Default
Valid range: `[1 .. 1GB]`

`100`
Default: `100`

#### Example
## Default parameters for Cuckoo filters

```
$ redis-server --loadmodule /path/to/redisbloom.so INITIAL_SIZE 400
```
### cf-bucket-size

Added in v8.0.0.

The number of items in each Cuckoo filter bucket.

Type: integer

Valid range: `[1 .. 255]`

Default: `2`

### cf-initial-size

Added in v8.0.0.

Cuckoo filter initial capacity.

Type: integer

Valid range: `[2*CF_BUCKET_SIZE .. 1GB]`

Default: `1024`

### CF_MAX_EXPANSIONS
### cf-expansion-factor

Default maximum expansions for Cuckoo filters.
Added in v8.0.0.

#### Default
Expansion factor for Cuckoo filters.

`32`
Type: integer

#### Example
Valid range: `[0 .. 32768]`

Default: `1`

### cf-max-expansions

The maximum number of expansions for Cuckoo filters.

Type: integer

Valid range: `[1 .. 65535]`

Default: `32`

### cf-max-iterations

Added in v8.0.0

The maximum number of iterations for Cuckoo filters.

Type: integer

Valid range: `[1 .. 65535]`

Default: `20`

## Setting configuration parameters on module load (deprecated)

These methods are deprecated beginning with Redis CE v8.0.0.

Setting configuration parameters at load-time is done by appending arguments after the `--loadmodule` argument when starting a server from the command line or after the `loadmodule` directive in a Redis config file. For example:

In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}):

```sh
loadmodule ./redisbloom.so [OPT VAL]...
```
$ redis-server --loadmodule /path/to/redisbloom.so CF_MAX_EXPANSIONS 16

From the [Redis CLI]({{< relref "/develop/tools/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command:

```
127.0.0.6379> MODULE LOAD redisbloom.so [OPT VAL]...
```

From the command line:

```sh
$ redis-server --loadmodule ./redisbloom.so [OPT VAL]...
```
Loading

0 comments on commit 43a231d

Please sign in to comment.