ApsaraDB for Redis allows you to customize instance parameters. This topic describes the parameters of different engine versions and the common methods to set these parameters.
Precautions
Some parameters are dependent on the minor version of the instance. If the minor version is too low, an error may occur when you set specific parameters. We recommend that you upgrade the instance to the latest minor version. For more information, see Upgrade the minor version.
Modify parameters in the ApsaraDB for Redis console
- Log on to the ApsaraDB for Redis console.
- On the top of the page, select the region where the instance is deployed.
- On the Instance List page, click the Instance ID of the instance.
- In the left-side navigation pane, click System Parameters.
- On the System Parameters page, find the parameter that you want to modify and click
Modify in the Actions column.
- In the dialog box that appears, modify the parameter value and click OK. For more
information about parameters and parameter values, see the following description based
on the version of the Redis engine.
Warning After you modify specific parameters, the instance is automatically restarted. Transient connection errors occur on the instance during the restart process. Modify parameters with caution. Before you modify a parameter, you can check whether the instance must be restarted after you modify the parameter in the Restart and Take Effect column of the parameter.
- Click OK.
Parameter description
Different engine versions and architectures of ApsaraDB for Redis support different parameters. You can view the detailed descriptions of parameters of specific engine versions by clicking the hyperlinks in the following table.
The ✔️ symbol in this topic indicates that the architecture supports the specific parameter. The ❌ symbol indicates that the architecture does not support the specific parameter.
Engine version | Reference |
---|---|
Redis 5.0 | Parameters supported by Redis 5.0 |
Redis 4.0 | Parameters supported by Redis 4.0 |
Redis 2.8 | Parameters supported by Redis 2.8 |
Parameters supported by Redis 5.0
Parameter | Description | Standard instance | Cluster instance | Read/write splitting instance |
---|---|---|---|---|
#no_loose_audit-read-enabled |
Specifies whether to enable read request audit. After you enable this feature, you
can view information about read requests in the audit log. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_check-whitelist-always |
Specifies whether to verify that the client IP address is in a whitelist of the ApsaraDB
for Redis instance if password-free access is enabled in a virtual private cloud (VPC).
If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC. Valid values:
|
✔️ | ✔️ | ✔️ |
#no_loose_disabled-commands |
Specifies the commands to be disabled. You can disable risky commands or commands
that have high time complexity, such as flushall, flushdb, keys, hgetall, eval, evalsha, and script.
Note The commands must be written in lowercase letters. Separate multiple commands with
commas (,).
|
✔️ | ✔️ | ✔️ |
#no_loose_sentinel-enabled |
Specifies whether to enable the Sentinel-compatible mode. Valid values:
|
✔️ | ✔️ | ✔️ |
#no_loose_ssl-enabled |
Specifies whether to enable secure sockets layer (SSL) encryption. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_statistics-cmds |
The name of the command for which you want to collect statistics. This parameter is empty by default. This indicates that no statistics are collected for the command. Separate multiple commands with commas (,). |
❌ | ✔️ | ✔️ |
#no_loose_statistics-ip-enable |
Specifies whether to collect statistics about IP addresses. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_statistics-keys |
The key for which you want to collect statistics. By default, the value is empty. This indicates that no statistics are collected. Separate multiple keys with commas (,). |
❌ | ✔️ | ✔️ |
#no_loose_tls-min-version |
Specifies the minimum TLS version supported by the instance. Valid values:
|
❌ | ✔️ | ✔️ |
cluster_compat_enable |
Specifies whether to enable support for Redis-native cluster syntax. Valid values:
|
❌ | ✔️ | ✔️ |
max_session_processing |
Specifies the maximum number of pending requests that are allowed per connection. If a proxy node forwards requests from a client to a data node but does not receive a response from the data node, then the requests are pending. This parameter is used to prevent pending requests that are caused by capability differences between the frontend and backend of proxy nodes. This avoids an increase in memory usage. |
❌ | ✔️ | ✔️ |
ptod_enabled |
Specifies whether to forward client IP addresses to data nodes through the proxy node.
Valid values:
|
❌ | ✔️ | ✔️ |
readonly_lua_route_ronode_enable |
Specifies whether to enable Lua scripting on read replicas. Valid values:
|
❌ | ❌ | ✔️ |
read_request_only_ronode_whenrwsplit_enable |
Specifies whether to enable unidirectional forwarding for requests from accounts that
have read-only permissions. Valid values:
|
❌ | ❌ | ✔️ |
rt_threshold_ms |
Specifies the threshold of slow query logs for a proxy node. Unit: milliseconds. If
it takes longer than the threshold for the proxy node to process a request, the request
is recorded in a slow query log.
Note This timing starts when the proxy node sends a request to the data node and ends when
the proxy node receives the response.
|
❌ | ✔️ | ✔️ |
script_check_enable |
Specifies whether to check that the keys used in Lua scripts are mapped to the same
slot. Valid values:
|
❌ | ✔️ | ✔️ |
transfer_subscrible_to_psubscrible_enable |
Specifies whether to enable the feature of converting SUBSCRIBE to PSUBSCRIBE. Valid values:
|
❌ | ✔️ | ✔️ |
appendonly |
Specifies whether to enable append-only file (AOF) persistence. Valid values:
|
✔️ | ✔️ | ✔️ |
client-output-buffer-limit pubsub |
Specifies output buffer limits of publisher and subscriber clients. The clients are
disconnected when the specified limits are reached. Specify this parameter in the
following format:
<hard limit> <soft limit> <soft seconds> . Default value: 33554432 8388608 60.
|
✔️ | ✔️ | ✔️ |
dynamic-hz |
Specifies whether to enable a dynamic hz value. Valid values:
|
✔️ | ❌ | ❌ |
hash-max-ziplist-entries |
Specifies the maximum number of bytes of the key or value of each key-value pair stored
in a hash. The ziplist encoding is used only if both of the following conditions are
met:
|
✔️ | ✔️ | ✔️ |
hash-max-ziplist-value |
Specifies the maximum number of bytes of the key or value of each key-value pair stored
in a hash. The ziplist encoding is used only if both of the following conditions are
met:
|
✔️ | ✔️ | ✔️ |
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. The value specifies that each task is performed 10
times per second.
Note A higher value results in higher CPU consumption but allows the system to delete expired
keys and terminate timeout connections more frequently. We recommend that you specify
a value smaller than or equal to 100.
|
✔️ | ✔️ | ✔️ |
lazyfree-lazy-eviction |
Specifies whether to enable the eviction feature based on the lazyfree mechanism.
Valid values:
|
✔️ | ✔️ | ✔️ |
lazyfree-lazy-expire |
Specifies whether to delete expired keys based on the lazyfree mechanism. Valid values:
|
✔️ | ✔️ | ✔️ |
lazyfree-lazy-server-del |
Specifies whether to run the DEL command and asynchronously delete data based on the lazyfree mechanism. Valid values:
|
✔️ | ✔️ | ✔️ |
list-compress-depth |
Specifies the number of nodes that are not compressed at both ends of a list. Valid
values: 0 to 65535.
|
✔️ | ✔️ | ✔️ |
list-max-ziplist-size |
|
✔️ | ✔️ | ✔️ |
maxmemory-policy |
Specifies the policy used to evict keys if the memory is exhausted. Valid values:
LRU means least recently used. LFU means least frequently used. LRU, LFU, and TTL
are implemented by using approximation and randomized algorithms.
|
✔️ | ✔️ | ✔️ |
notify-keyspace-events |
The types of events of which the Redis server can notify clients. The value of this
parameter is a combination of the following characters.
Note The specified parameter must include at least K or E. Otherwise, no event is triggered.
|
✔️ | ✔️ | ✔️ |
set-max-intset-entries |
The maximum number of data entries in a set to support intset encoding. A set uses
intset encoding when both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
slowlog-log-slower-than |
Specifies the threshold to log slow queries. You can set this parameter to record operations with the specified execution time in microseconds. Valid values: 10000 to 10000000. Default value: 10000. |
✔️ | ✔️ | ✔️ |
slowlog-max-len |
The maximum number of entries that can be stored in the slow query log. Valid values: 100 to 10000. Default value: 1024. |
✔️ | ✔️ | ✔️ |
stream-node-max-bytes |
The maximum amount of memory in bytes that each macro node in a stream can consume.
Valid values: 0 to 999999999999999. Unit: bytes.
Note A value of 0 indicates that the number of entries on each node is unlimited.
|
✔️ | ❌ | ❌ |
stream-node-max-entries |
The maximum number of entries stored on each macro node in a stream. Valid values:
0 to 999999999999999.
Note A value of 0 indicates that the number of entries on each node is unlimited.
|
✔️ | ❌ | ❌ |
timeout |
Specifies a timeout period. The system terminates a connection to a client if the
connection has been idle for the specified period of time. Valid values: 0 to 100000. Unit: seconds.
Note A value of 0 specifies that no time-out period is specified for connections.
|
✔️ | ❌ | ❌ |
zset-max-ziplist-entries |
Specifies the maximum number of key-value pairs stored in a sorted set. The ziplist
encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
zset-max-ziplist-value |
Specifies the maximum number of key-value pairs stored in a sorted set. The ziplist
encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
Parameters supported by Redis 4.0
Parameter | Description | Standard instance | Cluster instance | Read/write splitting instance |
---|---|---|---|---|
#no_loose_audit-read-enabled |
Specifies whether to enable read request audit. After you enable this feature, you
can view information about read requests in the audit log. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_check-whitelist-always |
Specifies whether to verify that the client IP address is in a whitelist of the ApsaraDB
for Redis instance if password-free access is enabled in a virtual private cloud (VPC).
If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC. Valid values:
|
✔️ | ✔️ | ✔️ |
#no_loose_disabled-commands |
Specifies the commands to be disabled. You can disable risky commands or commands
that have high time complexity, such as flushall, flushdb, keys, hgetall, eval, evalsha, and script.
Note The commands must be written in lowercase letters. Separate multiple commands with
commas (,).
|
✔️ | ✔️ | ✔️ |
#no_loose_sentinel-enabled |
Specifies whether to enable the Sentinel-compatible mode. Valid values:
|
✔️ | ✔️ | ✔️ |
#no_loose_ssl-enabled |
Specifies whether to enable secure sockets layer (SSL) encryption. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_statistics-cmds |
The name of the command for which you want to collect statistics. This parameter is empty by default. This indicates that no statistics are collected for the command. Separate multiple commands with commas (,). |
❌ | ✔️ | ✔️ |
#no_loose_statistics-ip-enable |
Specifies whether to collect statistics about IP addresses. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_statistics-keys |
The key for which you want to collect statistics. By default, the value is empty. This indicates that no statistics are collected. Separate multiple keys with commas (,). |
❌ | ✔️ | ✔️ |
#no_loose_tls-min-version |
Specifies the minimum TLS version supported by the instance. Valid values:
|
❌ | ✔️ | ✔️ |
cluster_compat_enable |
Specifies whether to enable support for Redis-native cluster syntax. Valid values:
|
❌ | ✔️ | ✔️ |
max_session_processing |
Specifies the maximum number of pending requests that are allowed per connection. If a proxy node forwards requests from a client to a data node but does not receive a response from the data node, then the requests are pending. This parameter is used to prevent pending requests that are caused by capability differences between the frontend and backend of proxy nodes. This avoids an increase in memory usage. |
❌ | ✔️ | ✔️ |
ptod_enabled |
Specifies whether to forward client IP addresses to data nodes through the proxy node.
Valid values:
|
❌ | ✔️ | ✔️ |
readonly_lua_route_ronode_enable |
Specifies whether to enable Lua scripting on read replicas. Valid values:
|
❌ | ❌ | ✔️ |
read_request_only_ronode_whenrwsplit_enable |
Specifies whether to enable unidirectional forwarding for requests from accounts that
have read-only permissions. Valid values:
|
❌ | ❌ | ✔️ |
rt_threshold_ms |
Specifies the threshold of slow query logs for a proxy node. Unit: milliseconds. If
it takes longer than the threshold for the proxy node to process a request, the request
is recorded in a slow query log.
Note This timing starts when the proxy node sends a request to the data node and ends when
the proxy node receives the response.
|
❌ | ✔️ | ✔️ |
script_check_enable |
Specifies whether to check that the keys used in Lua scripts are mapped to the same
slot. Valid values:
|
❌ | ✔️ | ✔️ |
transfer_subscrible_to_psubscrible_enable |
Specifies whether to enable the feature of converting SUBSCRIBE to PSUBSCRIBE. Valid values:
|
❌ | ✔️ | ✔️ |
appendonly |
Specifies whether to enable append-only file (AOF) persistence. Valid values:
|
✔️ | ✔️ | ✔️ |
client-output-buffer-limit pubsub |
Specifies output buffer limits of publisher and subscriber clients. The clients are
disconnected when the specified limits are reached. Specify this parameter in the
following format:
<hard limit> <soft limit> <soft seconds> . Default value: 33554432 8388608 60.
|
✔️ | ✔️ | ✔️ |
hash-max-ziplist-entries |
Specifies the maximum number of bytes of the key or value of each key-value pair stored
in a hash. The ziplist encoding is used only if both of the following conditions are
met:
|
✔️ | ✔️ | ✔️ |
hash-max-ziplist-value |
Specifies the maximum number of bytes of the key or value of each key-value pair stored
in a hash. The ziplist encoding is used only if both of the following conditions are
met:
|
✔️ | ✔️ | ✔️ |
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. The value specifies that each task is performed 10
times per second.
Note A higher value results in higher CPU consumption but allows the system to delete expired
keys and terminate timeout connections more frequently. We recommend that you specify
a value smaller than or equal to 100.
|
✔️ | ✔️ | ✔️ |
lazyfree-lazy-eviction |
Specifies whether to enable the eviction feature based on the lazyfree mechanism.
Valid values:
|
✔️ | ✔️ | ✔️ |
lazyfree-lazy-expire |
Specifies whether to delete expired keys based on the lazyfree mechanism. Valid values:
|
✔️ | ✔️ | ✔️ |
lazyfree-lazy-server-del |
Specifies whether to run the DEL command and asynchronously delete data based on the lazyfree mechanism. Valid values:
|
✔️ | ✔️ | ✔️ |
list-compress-depth |
Specifies the number of nodes that are not compressed at both ends of a list. Valid
values: 0 to 65535.
|
✔️ | ✔️ | ✔️ |
list-max-ziplist-size |
|
✔️ | ✔️ | ✔️ |
maxmemory-policy |
Specifies the policy used to evict keys if the memory is exhausted. Valid values:
LRU means least recently used. LFU means least frequently used. LRU, LFU, and TTL
are implemented by using approximation and randomized algorithms.
|
✔️ | ✔️ | ✔️ |
notify-keyspace-events |
The types of events of which the Redis server can notify clients. The value of this
parameter is a combination of the following characters.
Note The specified parameter must include at least K or E. Otherwise, no event is triggered.
|
✔️ | ✔️ | ✔️ |
set-max-intset-entries |
The maximum number of data entries in a set to support intset encoding. A set uses
intset encoding when both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
slowlog-log-slower-than |
Specifies the threshold to log slow queries. You can set this parameter to record operations with the specified execution time in microseconds. Valid values: 10000 to 10000000. Default value: 10000. |
✔️ | ✔️ | ✔️ |
slowlog-max-len |
The maximum number of entries that can be stored in the slow query log. Valid values: 100 to 10000. Default value: 1024. |
✔️ | ✔️ | ✔️ |
timeout |
Specifies a timeout period. The system terminates a connection to a client if the
connection has been idle for the specified period of time. Valid values: 0 to 100000. Unit: seconds.
Note A value of 0 specifies that no time-out period is specified for connections.
|
✔️ | ❌ | ❌ |
zset-max-ziplist-entries |
Specifies the maximum number of key-value pairs stored in a sorted set. The ziplist
encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
zset-max-ziplist-value |
Specifies the maximum number of key-value pairs stored in a sorted set. The ziplist
encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
Parameters supported by Redis 2.8
Parameter | Description | Standard instance | Cluster instance | Read/write splitting instance |
---|---|---|---|---|
#no_loose_audit-read-enabled |
Specifies whether to enable read request audit. After you enable this feature, you
can view information about read requests in the audit log. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_disabled-commands |
Specifies the commands to be disabled. You can disable risky commands or commands
that have high time complexity, such as flushall, flushdb, keys, hgetall, eval, evalsha, and script.
Note The commands must be written in lowercase letters. Separate multiple commands with
commas (,).
|
✔️ | ✔️ | ✔️ |
#no_loose_ssl-enabled |
Specifies whether to enable secure sockets layer (SSL) encryption. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_statistics-cmds |
The name of the command for which you want to collect statistics. This parameter is empty by default. This indicates that no statistics are collected for the command. Separate multiple commands with commas (,). |
❌ | ✔️ | ✔️ |
#no_loose_statistics-ip-enable |
Specifies whether to collect statistics about IP addresses. Valid values:
|
❌ | ✔️ | ✔️ |
#no_loose_statistics-keys |
The key for which you want to collect statistics. By default, the value is empty. This indicates that no statistics are collected. Separate multiple keys with commas (,). |
❌ | ✔️ | ✔️ |
#no_loose_tls-min-version |
Specifies the minimum TLS version supported by the instance. Valid values:
|
❌ | ✔️ | ✔️ |
cluster_compat_enable |
Specifies whether to enable support for Redis-native cluster syntax. Valid values:
|
❌ | ✔️ | ✔️ |
max_session_processing |
Specifies the maximum number of pending requests that are allowed per connection. If a proxy node forwards requests from a client to a data node but does not receive a response from the data node, then the requests are pending. This parameter is used to prevent pending requests that are caused by capability differences between the frontend and backend of proxy nodes. This avoids an increase in memory usage. |
❌ | ✔️ | ✔️ |
read_request_only_ronode_whenrwsplit_enable |
Specifies whether to enable unidirectional forwarding for requests from accounts that
have read-only permissions. Valid values:
|
❌ | ❌ | ✔️ |
rt_threshold_ms |
Specifies the threshold of slow query logs for a proxy node. Unit: milliseconds. If
it takes longer than the threshold for the proxy node to process a request, the request
is recorded in a slow query log.
Note This timing starts when the proxy node sends a request to the data node and ends when
the proxy node receives the response.
|
❌ | ✔️ | ✔️ |
script_check_enable |
Specifies whether to check that the keys used in Lua scripts are mapped to the same
slot. Valid values:
|
❌ | ✔️ | ✔️ |
appendonly |
Specifies whether to enable append-only file (AOF) persistence. Valid values:
|
✔️ | ✔️ | ✔️ |
client-output-buffer-limit pubsub |
Specifies output buffer limits of publisher and subscriber clients. The clients are
disconnected when the specified limits are reached. Specify this parameter in the
following format:
<hard limit> <soft limit> <soft seconds> . Default value: 33554432 8388608 60.
|
✔️ | ✔️ | ✔️ |
hash-max-ziplist-entries |
Specifies the maximum number of bytes of the key or value of each key-value pair stored
in a hash. The ziplist encoding is used only if both of the following conditions are
met:
|
✔️ | ✔️ | ✔️ |
hash-max-ziplist-value |
Specifies the maximum number of bytes of the key or value of each key-value pair stored
in a hash. The ziplist encoding is used only if both of the following conditions are
met:
|
✔️ | ✔️ | ✔️ |
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. The value specifies that each task is performed 10
times per second.
Note A higher value results in higher CPU consumption but allows the system to delete expired
keys and terminate timeout connections more frequently. We recommend that you specify
a value smaller than or equal to 100.
|
✔️ | ✔️ | ✔️ |
list-max-ziplist-entries |
Specifies the maximum number of bytes of the key or value of each key-value pair stored in a list. The ziplist encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
list-max-ziplist-value |
Specifies the maximum number of bytes of the key or value of each key-value pair stored in a list. The ziplist encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
maxmemory-policy |
Specifies the policy used to evict keys if the memory is exhausted. Valid values:
LRU means least recently used. LFU means least frequently used. LRU, LFU, and TTL
are implemented by using approximation and randomized algorithms.
|
✔️ | ✔️ | ✔️ |
notify-keyspace-events |
The types of events of which the Redis server can notify clients. The value of this
parameter is a combination of the following characters.
Note The specified parameter must include at least K or E. Otherwise, no event is triggered.
|
✔️ | ✔️ | ✔️ |
set-max-intset-entries |
The maximum number of data entries in a set to support intset encoding. A set uses
intset encoding when both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
slowlog-log-slower-than |
Specifies the threshold to log slow queries. You can set this parameter to record operations with the specified execution time in microseconds. Valid values: 10000 to 10000000. Default value: 10000. |
✔️ | ✔️ | ✔️ |
slowlog-max-len |
The maximum number of entries that can be stored in the slow query log. Valid values: 100 to 10000. Default value: 1024. |
✔️ | ✔️ | ✔️ |
zset-max-ziplist-entries |
Specifies the maximum number of key-value pairs stored in a sorted set. The ziplist
encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |
zset-max-ziplist-value |
Specifies the maximum number of key-value pairs stored in a sorted set. The ziplist
encoding is used only if both of the following conditions are met:
|
✔️ | ✔️ | ✔️ |