|
| 1 | +--- |
| 2 | +categories: |
| 3 | +- docs |
| 4 | +- develop |
| 5 | +- stack |
| 6 | +- oss |
| 7 | +- rs |
| 8 | +- rc |
| 9 | +- oss |
| 10 | +- kubernetes |
| 11 | +- clients |
| 12 | +description: Redis probabilistic data structures support multiple configuration parameters. |
| 13 | +linkTitle: Configuration |
| 14 | +title: Configuration Parameters |
| 15 | +weight: 100 |
| 16 | +--- |
| 17 | +{{< note >}} |
| 18 | +As of Redis Community Edition (CE) 8.0, configuration parameters for the probabilistic data structures are now set in the following ways: |
| 19 | +* At load time via your `redis.conf` file. |
| 20 | +* At run time (where applicable) using the [`CONFIG SET`]({{< relref "/commands/config-set" >}}) command. |
| 21 | + |
| 22 | +Also, Redis CE 8.0 persists probabilistic configuration parameters just like any other configuration parameters (e.g., using the [`CONFIG REWRITE`]({{< baseurl >}}/commands/config-rewrite/) command). |
| 23 | +{{< /note >}} |
| 24 | + |
| 25 | + |
| 26 | +## Redis probabilistic data structure configuration parameters |
| 27 | + |
| 28 | +The following table summarizes which Bloom filter configuration parameters can be set at run-time, and compatibility with Redis Software and Redis Cloud |
| 29 | + |
| 30 | +| Parameter name<br />(version < 8.0) | Parameter name<br />(version ≥ 8.0) | Run-time | Redis<br />Software | Redis<br />Cloud | |
| 31 | +| :------- | :------- | :------- | :------- | :------- | |
| 32 | +| ERROR_RATE | [bf-error-rate](#bf-error-rate) | :white_check_mark: | <span title="Supported">✅ Supported</span><br /><span><br /></span> | <span title="Supported">✅ Flexible & Annual</span><br /><span title="Not supported"><nobr>❌ Free & Fixed</nobr></span> | |
| 33 | +| | [bf-expansion-factor](#bf-expansion-factor) | :white_check_mark: ||| |
| 34 | +| INITIAL_SIZE | [bf-initial-size](#bf-initial-size) | :white_check_mark: | <span title="Supported">✅ Supported</span><br /><span><br /></span> | <span title="Supported">✅ Flexible & Annual</span><br /><span title="Not supported"><nobr>❌ Free & Fixed</nobr></span> | |
| 35 | + |
| 36 | +The following table summarizes which Cuckoo filter configuration parameters can be set at run-time, and compatibility with Redis Software and Redis Cloud. |
| 37 | + |
| 38 | +| Parameter name<br />(version < 8.0) | Parameter name<br />(version ≥ 8.0) | Run-time | Redis<br />Software | Redis<br />Cloud | |
| 39 | +| :------- | :------- | :------- | :------- | :------- | |
| 40 | +| | [cf-bucket-size](#cf-bucket-size) | :white_check_mark: ||| |
| 41 | +| | [cf-initial-size](#cf-initial-size) | :white_check_mark: ||| |
| 42 | +| | [cf-expansion-factor](#cf-expansion-factor) | :white_check_mark: ||| |
| 43 | +| CF_MAX_EXPANSIONS | [cf-max-expansions](#cf-max-expansions) | :white_check_mark: | <span title="Supported">✅ Supported</span><br /><span><br /></span> | <span title="Supported">✅ Flexible & Annual</span><br /><span title="Not supported"><nobr>❌ Free & Fixed</nobr></span> | |
| 44 | +| | [cf-max-iterations](#cf-max-iterations) | :white_check_mark: ||| |
| 45 | + |
| 46 | +{{< note >}} |
| 47 | +Parameter names for Redis CE versions < 8.0, while deprecated, will still be supported in version 8.0. |
| 48 | +{{< /note >}} |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +{{< warning >}} |
| 53 | +A filter should always be sized for the expected capacity and the desired error rate. |
| 54 | +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. |
| 55 | +Not optimizing a filter for its intended use will result in degradation of performance and memory efficiency. |
| 56 | +{{< /warning >}} |
| 57 | + |
| 58 | +## Default parameters for Bloom filters |
| 59 | + |
| 60 | +### bf-error-rate |
| 61 | + |
| 62 | +Default error ratio for Bloom filters. |
| 63 | + |
| 64 | +Type: double |
| 65 | + |
| 66 | +Valid range: `[0 .. 1]` |
| 67 | + |
| 68 | +Default: `0.01` |
| 69 | + |
| 70 | +### bf-expansion-factor |
| 71 | + |
| 72 | +Added in v8.0.0. |
| 73 | + |
| 74 | +Expansion factor for Bloom filters. |
| 75 | + |
| 76 | +Type: integer |
| 77 | + |
| 78 | +Valid range: `[0 .. 32768]`. |
| 79 | + |
| 80 | +Default: `2` |
| 81 | + |
| 82 | +### bf-initial-size |
| 83 | + |
| 84 | +Initial capacity for Bloom filters. |
| 85 | + |
| 86 | +Type: integer |
| 87 | + |
| 88 | +Valid range: `[1 .. 1048576]` |
| 89 | + |
| 90 | +Default: `100` |
| 91 | + |
| 92 | +## Default parameters for Cuckoo filters |
| 93 | + |
| 94 | +### cf-bucket-size |
| 95 | + |
| 96 | +Added in v8.0.0. |
| 97 | + |
| 98 | +The number of items in each Cuckoo filter bucket. |
| 99 | + |
| 100 | +Type: integer |
| 101 | + |
| 102 | +Valid range: `[1 .. 255]` |
| 103 | + |
| 104 | +Default: `2` |
| 105 | + |
| 106 | +### cf-initial-size |
| 107 | + |
| 108 | +Added in v8.0.0. |
| 109 | + |
| 110 | +Cuckoo filter initial capacity. |
| 111 | + |
| 112 | +Type: integer |
| 113 | + |
| 114 | +Valid range: `[2*cf-bucket-size .. 1048576]` |
| 115 | + |
| 116 | +Default: `1024` |
| 117 | + |
| 118 | +### cf-expansion-factor |
| 119 | + |
| 120 | +Added in v8.0.0. |
| 121 | + |
| 122 | +Expansion factor for Cuckoo filters. |
| 123 | + |
| 124 | +Type: integer |
| 125 | + |
| 126 | +Valid range: `[0 .. 32768]` |
| 127 | + |
| 128 | +Default: `1` |
| 129 | + |
| 130 | +### cf-max-expansions |
| 131 | + |
| 132 | +The maximum number of expansions for Cuckoo filters. |
| 133 | + |
| 134 | +Type: integer |
| 135 | + |
| 136 | +Valid range: `[1 .. 65535]` |
| 137 | + |
| 138 | +Default: `32` |
| 139 | + |
| 140 | +### cf-max-iterations |
| 141 | + |
| 142 | +Added in v8.0.0 |
| 143 | + |
| 144 | +The maximum number of iterations for Cuckoo filters. |
| 145 | + |
| 146 | +Type: integer |
| 147 | + |
| 148 | +Valid range: `[1 .. 65535]` |
| 149 | + |
| 150 | +Default: `20` |
| 151 | + |
| 152 | +## Setting configuration parameters on module load (deprecated) |
| 153 | + |
| 154 | +These methods are deprecated beginning with Redis CE v8.0.0. |
| 155 | + |
| 156 | +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: |
| 157 | + |
| 158 | +In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}): |
| 159 | + |
| 160 | +```sh |
| 161 | +loadmodule ./redisbloom.so [OPT VAL]... |
| 162 | +``` |
| 163 | + |
| 164 | +From the [Redis CLI]({{< relref "/develop/tools/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: |
| 165 | + |
| 166 | +``` |
| 167 | +127.0.0.6379> MODULE LOAD redisbloom.so [OPT VAL]... |
| 168 | +``` |
| 169 | + |
| 170 | +From the command line: |
| 171 | + |
| 172 | +```sh |
| 173 | +$ redis-server --loadmodule ./redisbloom.so [OPT VAL]... |
| 174 | +``` |
0 commit comments