You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of Redis Community Edition 8.0, configuration parameters for the time series data structure 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.
17
+
## Redis CE - Setting configuration parameters
21
18
22
-
Also, Redis CE 8.0 persists probabilistic configuration parameters just like any other configuration parameters (e.g., using the [`CONFIG REWRITE`]({{< relref "/commands/config-rewrite/" >}}) command).
23
-
{{< /note >}}
19
+
Previous to version 8.0, all time series configuration parameters were load-time parameters.
20
+
21
+
In order to change the values of a load-time parameter, you have to use one of the following methods:
22
+
23
+
- Pass them as command-line arguments following the `loadmodule` argument when starting redis-server
- Add them as arguments to the `loadmodule` directive in your configuration file (e.g., `redis.conf`):
28
+
29
+
`loadmodule ./{modulename}.so [OPT VAL]...`
30
+
31
+
- Using the `MODULE LOAD path [arg [arg ...]]` command.
32
+
33
+
- Using the `MODULE LOADEX path [CONFIG name value [CONFIG name value ...]] [ARGS args [args ....]]` command.
34
+
35
+
With the introduction of Redis 8.0, most of the time series configuration parameters are now runtime parameters. This means that their values can be changed at runtime.
36
+
You can still set runtime parameters at load-time, but it is less recommended.
37
+
Instead, you should use the Redis `CONFIG` command with time series runtime configuration parameters, in exactly the same way you would do for Redis runtime configuration parameters.
38
+
39
+
This means:
40
+
41
+
-`CONFIG SET parameter value [parameter value ...] `
42
+
43
+
Set one or more configuration parameters.
44
+
45
+
-`CONFIG GET parameter [parameter ...]`
46
+
47
+
Read the current value of one of more parameters.
48
+
49
+
-`CONFIG REWRITE`
50
+
51
+
Rewrite your Redis configuration file (e.g., the `redis.conf` file) to reflect the configuration changes.
52
+
53
+
You can also specify the value directly in your Redis configuration file (e.g., the `redis.conf` file) the same way you would do for Redis runtime configuration parameters.
54
+
55
+
Once a value is set with `CONFIG SET`, or added manually to your configuration file, it will overwrite values set with `--loadmodule`, `loadmodule`, `MODULE LOAD`, or `MODULE LOADEX`.
56
+
57
+
Note that on a cluster, `CONFIG SET` and `CONFIG REWRITE` have to be called on each node separately.
58
+
59
+
We also introduced new configuration parameters, and aligned the naming scheme of the module configuration parameters with Redis configuration parameters.
60
+
When using the `CONFIG` command, you must use the new names.
Default compaction rules for newly created key with [`TS.ADD`]({{< relref "commands/ts.add/" >}}), [`TS.INCRBY`]({{< relref "commands/ts.incrby/" >}}), and [`TS.DECRBY`]({{< relref "commands/ts.decrby/" >}}).
76
-
77
-
Note that `COMPACTION_POLICY` has no effect on keys created with [`TS.CREATE`]({{< relref "commands/ts.create/" >}}). To understand the motivation for this behavior, consider the following scenario: Suppose a `COMPACTION_POLICY` is defined, but then one wants to manually create an additional compaction rule (using [`TS.CREATERULE`]({{< relref "commands/ts.createrule/" >}})) which requires first creating an empty destination key (using [`TS.CREATE`]({{< relref "commands/ts.create/" >}})). But now there is a problem: due to the `COMPACTION_POLICY`, automatic compactions would be undesirably created for that destination key.
100
+
Note that this configuration parameter has no effect on keys created with [`TS.CREATE`]({{< relref "commands/ts.create/" >}}). To understand the motivation for this behavior, consider the following scenario: Suppose a default compaction policy is defined, but then one wants to manually create an additional compaction rule (using [`TS.CREATERULE`]({{< relref "commands/ts.createrule/" >}})) which requires first creating an empty destination key (using [`TS.CREATE`]({{< relref "commands/ts.create/" >}})). But now there is a problem: due to the default compaction policy, automatic compactions would be undesirably created for that destination key.
78
101
79
102
Each rule is separated by a semicolon (`;`), the rule consists of multiple fields that are separated by a colon (`:`):
80
103
@@ -127,7 +150,7 @@ Each rule is separated by a semicolon (`;`), the rule consists of multiple field
127
150
Assure that there is a bucket that starts at exactly _alignTimestamp_ after the epoch and align all other buckets accordingly. Default value: 0 (aligned with the epoch). Example: if _bucketDuration_ is 24 hours, setting _alignTimestamp_ to `6h` (6 hours after the Epoch) will ensure that each bucket’s timeframe is [06:00 .. 06:00).
128
151
129
152
{{% warning %}}
130
-
In a clustered environment, if you set `COMPACTION_POLICY`, you must use [hash tags]({{< relref "/operate/oss_and_stack/reference/cluster-spec" >}}#hash-tags) for all time series key names. This ensures that Redis will create each compaction in the same hash slot as its source key. If you don't, the system may fail to compact the data without displaying any error messages.
153
+
In a clustered environment, if you set this configuration parameter, you must use [hash tags]({{< relref "/operate/oss_and_stack/reference/cluster-spec" >}}#hash-tags) for all time series key names. This ensures that Redis will create each compaction in the same hash slot as its source key. If you don't, the system may fail to compact the data without displaying any error messages.
131
154
{{% /warning %}}
132
155
133
156
When a compaction policy is defined, compaction rules will be created automatically for newly created time series, and their key would be set to:
@@ -145,42 +168,10 @@ When a compaction policy is defined, compaction rules will be created automatica
145
168
-`max:1M:1h` - Aggregate using `max` over one-minute windows and retain the last hour
146
169
-`twa:1d:0m:360M` - Aggregate daily [06:00 .. 06:00) using `twa`; no expiration
147
170
148
-
### ts-duplicate-policy
171
+
### DUPLICATE_POLICY / ts-duplicate-policy
149
172
150
173
The default policy for handling insertion ([`TS.ADD`]({{< relref "/commands/ts.add/" >}}) and [`TS.MADD`]({{< relref "/commands/ts.madd/" >}})) of multiple samples with identical timestamps, with one of the following values:
Default retention period, in milliseconds, for newly created keys.
161
-
162
-
Retention period is the maximum age of samples compared to highest reported timestamp, per key. Samples are expired based solely on the difference between their timestamp and the timestamps passed to subsequent [`TS.ADD`]({{< relref "commands/ts.add/" >}}), [`TS.MADD`]({{< relref "commands/ts.madd/" >}}), [`TS.INCRBY`]({{< relref "commands/ts.incrby/" >}}), and [`TS.DECRBY`]({{< relref "commands/ts.decrby/" >}}) calls.
163
-
164
-
The value `0` means no expiration.
165
-
166
-
When both `COMPACTION_POLICY` and `RETENTION_POLICY` are specified, the retention of newly created compactions is according to the retention time specified in `COMPACTION_POLICY`.
Is policy for handling insertion ([`TS.ADD`]({{< relref "commands/ts.add/" >}}) and [`TS.MADD`]({{< relref "commands/ts.madd/" >}})) of multiple samples with identical timestamps, with one of the following values:
$ CONFIG SET ts-compaction-policy max:1m:1h;min:10s:5d:10d;last:5M:10m;avg:2h:10d;avg:3d:100d
211
+
```
212
+
213
+
### RETENTION_POLICY / ts-retention-policy
214
+
215
+
Default retention period, in milliseconds, for newly created keys.
216
+
217
+
Retention period is the maximum age of samples compared to highest reported timestamp, per key. Samples are expired based solely on the difference between their timestamp and the timestamps passed to subsequent [`TS.ADD`]({{< relref "commands/ts.add/" >}}), [`TS.MADD`]({{< relref "commands/ts.madd/" >}}), [`TS.INCRBY`]({{< relref "commands/ts.incrby/" >}}), and [`TS.DECRBY`]({{< relref "commands/ts.decrby/" >}}) calls.
218
+
219
+
Type: integer
220
+
221
+
Valid range: `[0 .. 9,223,372,036,854,775,807]`
222
+
223
+
Default: `0`
224
+
225
+
The value `0` means no expiration.
226
+
227
+
When both `COMPACTION_POLICY` / `ts-compaction-policy` and `RETENTION_POLICY` / `ts-retention-policy` are specified, the retention of newly created compactions is according to the retention time specified in `COMPACTION_POLICY` / `ts-compaction-policy`.
### ts-ignore-max-time-diff and ts-ignore-max-val-diff
257
+
### IGNORE_MAX_TIME_DIFF / ts-ignore-max-time-diff and IGNORE_MAX_VAL_DIFF / ts-ignore-max-val-diff
221
258
222
259
Default values for newly created keys.
223
260
@@ -247,7 +284,7 @@ A new sample is considered a duplicate and is ignored if the following condition
247
284
248
285
where `max_timestamp` is the timestamp of the sample with the largest timestamp in the time series, and `value_at_max_timestamp` is the value at `max_timestamp`.
249
286
250
-
### ts-num-threads
287
+
### NUM_THREADS / ts-num-threads
251
288
252
289
The maximum number of per-shard threads for cross-key queries when using cluster mode ([`TS.MRANGE`]({{< relref "/commands/ts.mrange/" >}}), [`TS.MREVRANGE`]({{< relref "/commands/ts.mrevrange/" >}}), [`TS.MGET`]({{< relref "/commands/ts.mget/" >}}), and [`TS.QUERYINDEX`]({{< relref "/commands/ts.queryindex/" >}})). The value must be equal to or greater than `1`. Note that increasing this value may either increase or decrease the performance!
253
290
@@ -263,42 +300,21 @@ Redis Cloud defaults:
263
300
- Flexible & Annual: Set by plan
264
301
- Free & Fixed: `1`
265
302
266
-
### ts-retention-policy
267
-
268
-
Default retention period, in milliseconds, for newly created keys.
269
-
270
-
Type: integer
271
-
272
-
Valid range: `[0 .. 9,223,372,036,854,775,807]`
273
-
274
-
Default: `0`
275
-
276
-
Retention period is the maximum age of samples compared to highest reported timestamp, per key. Samples are expired based solely on the difference between their timestamps and the timestamps passed to subsequent [`TS.ADD`]({{< relref "/commands/ts.add/" >}}), [`TS.MADD`]({{< relref "/commands/ts.madd/" >}}), [`TS.INCRBY`]({{< relref "/commands/ts.incrby/" >}}), and [`TS.DECRBY`]({{< relref "/commands/ts.decrby/" >}}) calls.
277
-
278
-
The value `0` means no expiration.
279
-
280
-
When both `ts-compaction-policy` and `ts-retention-policy` are specified, the retention of newly created compactions is according to the retention time specified in `ts-compaction-policy`.
281
-
282
-
## Setting configuration parameters on module load (deprecated)
283
-
284
-
These methods are deprecated beginning with Redis CE v8.0.0.
285
-
286
-
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:
303
+
#### Example
287
304
288
-
In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}):
Previous to version 8.0, when using a cluster with time series, you had to set the `OSS_GLOBAL_PASSWORD` configuration parameter on all the cluster nodes. Starting with version 8.0, this parameter is obsolete, and ignored if present. Redis now utilizes a new shared secret mechanism to allow sending internal commands between cluster nodes.
0 commit comments