You can customize the parameters of your Tair (Redis OSS-compatible) instance to improve its performance and security. The supported parameters vary based on the engine version and architecture. This topic provides detailed descriptions of the supported parameters.
Precautions
If the
Parameter is not supported for current versionerror is returned when you configure parameters, update the minor version of your instance. For more information, see Update the minor version of an instance.After you submit the modifications for specific parameters, your instance is automatically restarted. During the restart, the instance encounters transient connections that last for a few seconds. On the page for modifying parameters, the Restart and Take Effect column indicates whether the instance must be restarted for the modifications to take effect. For more information, see Configure parameters.
This topic describes the parameters for Redis Open-Source Edition instances. For information about the parameters for Tair (Enterprise Edition) instances, including memory-optimized, persistent memory, and disk-based instances, see Configuration parameters for Tair (Enterprise Edition).
Supported parameters
For readability and clarity, the following conventions are used in the tables in this topic:
✔️: The parameter is supported by the major version or architecture.
❌: The parameter is not supported by the major version or architecture.
To ensure instance stability, only some parameters can be configured. If a parameter is not listed in this topic, you cannot configure it.
For more information about architectures, see Standard architecture, Cluster architecture, and Read/write splitting architecture.
Database kernel parameters
Parameter | Description | Instance major version and architecture | ||||
Version 7.0 | Version 6.0 | Version 5.0 | Version 4.0 | Version 2.8 | ||
#no_loose_check-whitelist-always | Specifies whether to check that the IP address of a client is added to a whitelist of the instance after password-free access is enabled for the instance. The client is deployed in the same virtual private cloud (VPC) as the instance. Valid values:
Note This parameter is available only for classic instances. | ❌ | ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
#no_loose_disabled-commands | The disabled commands. You can use this parameter to disable the commands that may have high risks or high time complexity based on your business requirements, such as FLUSHALL, FLUSHDB, KEYS, HGETALL, EVAL, EVALSHA, and SCRIPT. Note
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
#no_loose_sentinel-enabled | Specifies whether to enable the Sentinel-compatible mode for standard instances or cluster instances in direct connection mode. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ❌ | ❌ |
#no_loose_sentinel-password-free-access | When Sentinel mode is enabled, specifies whether to allow password-free execution of Sentinel-related commands. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ |
#no_loose_sentinel-password-free-commands | After you enable Sentinel mode and the #no_loose_sentinel-password-free-access parameter, you can use this parameter to add a list of extra password-free commands. The default value is empty. Important
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ |
#no_loose_tls-min-version | Sets the minimum TLS version supported by the instance. Valid values:
| Standard ❌ Cluster ✔️ Read/write splitting ✔️ | Standard ❌ Cluster ✔️ Read/write splitting ✔️ | Standard ❌ Cluster ✔️ Read/write splitting ✔️ | Standard ❌ Cluster ✔️ Read/write splitting ✔️ | Standard ❌ Cluster ✔️ Read/write splitting ✔️ |
appendfsync | The frequency at which to perform the fsync operation for append-only file (AOF) persistence. The default value is everysec and cannot be changed. This parameter is available only if the appendonly parameter is set to yes. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
appendonly | Specifies whether to enable AOF persistence for master nodes. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
| The pubsub parameter limits the output buffer for publish/subscribe clients. The default value is 33554432 8388608 60. The normal parameter limits the output buffer for normal clients. The default value is 524288000 0 0. The parameter format is
Important
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
dynamic-hz | Enables or disables dynamic hz. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ |
| The maximum number and size of key-value pairs stored in a hash. Ziplist encoding is used only if a hash meets both of the following conditions:
| ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
| For instances compatible with Redis 7.0 or later, listpack is used as the default codec for hashing. When a hash object meets both of the following conditions, listpack encoding is used.
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ | ❌ |
hz | Specifies how frequently tasks are performed in the background. For example, you can specify how frequently tasks are performed to evict expired keys. Valid values: 1 to 500. The default value is 10, which specifies that each task is performed 10 times per second. Note A larger value results in higher CPU consumption but allows the system to delete expired keys more frequently and close timed-out connections more precisely. We recommend that you specify a value less than or equal to 100. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
latency-tracking | Specifies whether to enable command latency monitoring. Valid values:
Note This parameter is supported only by instances that are compatible with Redis 7.0 or later. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ | ❌ |
lazyfree-lazy-eviction | Specifies whether to enable lazyfree-based eviction. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
lazyfree-lazy-expire | Specifies whether to enable lazyfree-based deletion of expired keys. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
lazyfree-lazy-server-del | Specifies whether the DEL command asynchronously deletes data based on lazyfree. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
lazyfree-lazy-user-del | Specifies whether to asynchronously delete data based on lazyfree when the DEL command is executed. Valid values:
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ |
lazyfree-lazy-user-flush | Specifies whether to automatically convert the FLUSHDB, FLUSHALL, SCRIPT FLUSH, and FUNCTION FLUSH commands to the Lazyfree asynchronous deletion mode. Valid values:
Note This parameter is supported only by instances that are compatible with Redis 7.0 or later. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ | ❌ |
list-compress-depth | The number of nodes that are not compressed at both ends of a list. Valid values: 0 to 65535.
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
list-max-ziplist-entries | This set of parameters is supported only by instances that are compatible with Redis 2.8. When a List object meets both of the following conditions, ziplist encoding is used.
| ❌ | ❌ | ❌ | ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
list-max-ziplist-value | ||||||
| For instances compatible with Redis 6.0 or earlier, ziplist is used as the default codec for Lists (the list-max-ziplist-size parameter). For instances compatible with Redis 7.0 or later, listpack is used as the default codec for Lists (the list-max-listpack-size parameter).
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
maxmemory-policy | The policy used to evict keys if memory is exhausted. If the memory usage of your instance reaches the value of Maxmemory, data eviction is triggered. You can choose a data eviction policy based on your needs. Valid values: Note
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
maxmemory-eviction-tenacity | The data eviction factor, used to set the delay for each data eviction. The value can range from 0 to 100. The default value is 10.
Note This parameter is supported only by Redis 7.0. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ | ❌ |
active-expire-effort | The expired key (Expire) deletion factor, used to set the delay for each deletion of an expired key. The value can range from 1 to 10. The default value is 1. A larger value deletes expired keys faster but also consumes more CPU resources. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ |
notify-keyspace-events | The types of events of which the server can notify clients. The value of this parameter is a combination of the following characters. This parameter setting applies to all databases in the instance. These notifications consume CPU resources. For more information, see Redis keyspace notifications.
Important The specified value must include at least K or E. Otherwise, no notifications are sent. For example, if you want to be notified of expiration events, set this parameter to | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
set-max-intset-entries | When the data in a Set collection meets the following conditions, intset encoding is used.
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
slowlog-log-slower-than | The threshold for slow query logs. Commands whose running time exceeds this threshold are recorded in slow query logs. Unit: microsecond (μs). The default value is 20000 (20 ms). The value can range from 10000 to 10000000. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
slowlog-max-len | The maximum number of records that can be saved in a slow query log. The value can range from 100 to 10000. The default value is 1024. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
stream-node-max-bytes | The maximum memory that each macro node in a Stream can occupy. The value can range from 0 to 999,999,999,999,999. Note A value of 0 indicates no limit. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ |
stream-node-max-entries | The maximum number of entries that can be stored in each macro node in a Stream. The value can range from 0 to 999,999,999,999,999. Note A value of 0 indicates no limit. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ |
tracking-table-max-keys | Sets the upper limit on the number of keys stored in the Tracking Table. The value can range from 0 to 1000000000. The default value is 1000000. Note This parameter is supported only by Redis 7.0. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ | ❌ |
timeout | The timeout period. The system closes a connection to a client for the instance if the connection remains idle for the specified period of time. Valid values: 0 to 100000. Unit: seconds. The default value is 0, which indicates that no timeout period is specified. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ |
| The maximum number and size of key-value pairs stored in a sorted set. Ziplist encoding is used only if a sorted set meets both of the following conditions:
| ❌ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ |
| For instances compatible with Redis 7.0 or later, listpack is used as the default codec for Zset. When a Zset meets both of the following conditions, listpack encoding is used.
| Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ | ❌ | ❌ |
bigkey-threshold | The threshold for the number of elements for large keys (keys with many elements) in Top Key statistics. The default value is 2000. The value can range from 500 to 100000. Note If this parameter is not displayed in the parameter settings, update the minor version and try again. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ |
| The threshold for hot keys (by QPS) in Top Key statistics. The default value is 5000. The value can range from 100 to 100000. Note This parameter is supported only by minor versions 7.0.18, 6.0.2.9, 5.5.2.9, and later. | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | Standard ✔️ Cluster ✔️ Read/write splitting ✔️ | ❌ | ❌ |
Proxy node parameters
The following parameters are provided by proxy nodes. These parameters are supported only by instances that use the cluster architecture in proxy mode or the read/write splitting architecture.
Parameter | Description |
cluster_compat_enable | Specifies whether to enable compatibility with native Redis cluster syntax. Valid values:
|
hello_enabled | Specifies whether to enable switching between the RESP2 and RESP3 protocols using the HELLO command. Valid values:
Note This parameter is supported only by Proxy 7.0.9 and later versions. |
max_session_processing | The maximum number of requests that can be stacked for a single connection. The value can range from 10 to 10000000. The default value is 1000. A proxy node forwards a client's request to a data node. If the proxy node does not receive a reply from the data node, the request is in a stacked state. This parameter is mainly used to limit request stacking caused by differences in processing capabilities between the proxy and data nodes, preventing memory growth issues. |
| This group of parameters is part of the observability feature. After you set these parameters, you must also enable the audit log feature for them to take effect. The statistic period is 5 seconds per collection.
Note
|
ptod_enabled | Specifies whether to pass through the client IP address to data nodes. Valid values:
|
readonly_lua_route_ronode_enable | Enables or disables the Lua execution mode for read replicas. Valid values:
|
read_request_only_ronode_whenrwsplit_enable | Enables or disables directional forwarding for read-only account requests. Valid values:
|
rt_threshold_ms | The threshold for slow query logs in proxy nodes. Unit: millisecond (ms). The value can range from 30 to 2000. The default value is 500. Note If the time from when a request is sent from a proxy node to a data node until a response is received exceeds this threshold, a slow query log is generated. |
script_check_enable | Enables or disables the detection of Lua scripts by proxy nodes. For more information about the check items, see Proxy check items for Lua. Valid values:
|
sentinel_compat_enable | Specifies whether to enable the Sentinel-compatible mode for cluster instances in proxy mode or read/write splitting instances. Valid values:
|
transfer_subscrible_to_psubscrible_enable | Enables or disables the feature that converts SUBSCRIBE commands to PSUBSCRIBE commands. Valid values:
|