ApsaraDB for Redis allows you to customize instance parameters. This topic describes the parameters of different engine versions and the common methods to specify these parameters in the ApsaraDB for Redis console.

Custom parameters of Redis 5.0

Parameter Description Standard master-replica instance Cluster master-replica instance Read/write splitting instance
#no_loose_audit-read-enabled Specifies whether to enable read request audit. After you enable this feature, logs of read requests are displayed in audit logs. Not supported Supported Supported
#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:
  • yes: enables the system to check whether a client IP address is in a whitelist.
  • no: disables the system to check whether a client IP address is in a whitelist. This is the default value.
Supported Supported Supported
#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, based on your business requirements.
  • The commands must be written in lowercase letters. Separate multiple commands with commas (,).
Supported Supported Supported
#no_loose_ssl-enabled Specifies whether to enable secure sockets layer (SSL) encryption. Valid values:
  • yes: enables SSL encryption.
  • no: disables SSL encryption. This is the default value.
Not supported Supported Supported
#no_loose_sentinel-enabled Specifies whether to enable the compatibility with the Sentinel mode. Valid values:
  • yes: enables the compatibility with the Sentinel mode.
  • no: disables the compatibility with the Sentinel mode. This is the default value.
Supported Supported Supported
#no_loose_tls-min-version Specifies the minimum TLS version supported by the instance. Valid values:
  • TLSv1
  • TLSv1.1
  • TLSv1.2
Default value: TLSv1
Not supported Supported Not supported
read_request_only_ronode_whenrwsplit_enable Specifies whether to enable directional forwarding for requests from accounts that have read-only permissions. Valid values:
  • 1: enables directional forwarding. Requests from accounts that have read-only permissions are forwarded to only read replicas.
  • 0: disables directional forwarding. Requests from accounts that have read-only permissions are forwarded to all nodes including the primary node based on weights. This is the default value.
Not supported Not supported Supported
appendonly Specifies whether to enable append-only file (AOF) persistence. Valid values:
  • yes: enables AOF persistence. This is the default value.
  • no: disables AOF persistence.
Note If you set this parameter to no, AOF persistence is disabled on the master node and remains functional on the replica node.
Supported Supported Supported
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>.
  • hard limit: disconnects a client if the output buffer of the client is larger than or equal to the value specified by the hard limit field. Unit: bytes.
  • soft limit and soft seconds: disconnects a client if the two conditions are met. One of the condition is that the output buffer of the client is larger than or equal to the value specified by the soft limit field. The other condition is that the situation lasts for a period longer than or equal to the value specified by the soft seconds field. The soft limit value is measured in bytes, and the soft seconds value is measured in seconds.
Supported Supported Supported
dynamic-hz Specifies whether to enable a dynamic hz value. Valid values:
  • yes: enables a dynamic hz value. This is the default value.
  • no: disables a dynamic hz value.
Supported Not supported Not supported
hash-max-ziplist-entries

Specifies the maximum number of key-value pairs stored in a hash. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes of the key or value of each key-value pair stored in the hash is less than the value of the hash-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the hash is less than the value of the hash-max-ziplist-entries parameter.
Supported Supported Supported
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:

  1. The number of bytes of the key or value of each key-value pair stored in the hash is less than the value of the hash-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the hash is less than the value of the hash-max-ziplist-entries parameter.
Supported Supported Supported
hz Specifies the frequency at which Redis background tasks are performed, for example, tasks 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. A higher value results in higher CPU consumption but allows the system to delete expired keys and terminate time-out connections more frequently. We recommend that you specify a value less than or equal to 100. Supported Supported Supported
lazyfree-lazy-eviction Specifies whether to enable the eviction feature based on the lazyfree mechanism. Valid values:
  • yes: enables the feature.
  • no: disables the feature. This is the default value.
Supported Supported Supported
lazyfree-lazy-expire Specifies whether to delete expired keys based on the lazyfree mechanism. Valid values:
  • yes: enables the feature. This is the default value.
  • no: disables the feature.
Supported Supported Supported
lazyfree-lazy-server-del Specifies whether to run the DEL command and asynchronously delete data based on the lazyfree mechanism. Valid values:
  • yes: enables asynchronous deletion based on the lazyfree mechanism. This is the default value.
  • no: disables asynchronous deletion based on the lazyfree mechanism.
Supported Supported Supported
list-compress-depth

Specifies the number of entries that are not compressed at both ends of a list. Valid values: 0 to 65535.

  • 0: does not compress any node of the list. This is the default value.
  • 1: specifies that the first node from each end of the list is not compressed, but all nodes between these two nodes are compressed.
  • 2: specifies that the first two nodes from each end of the list are not compressed, but all nodes between these four nodes are compressed.
  • 3: specifies that the first three nodes from each end of the list are not compressed, but all nodes between these six nodes are compressed.
  • You can specify other values based on the same rule.
Supported Supported Supported
list-max-ziplist-size
  • The maximum length of a ziplist in a quicklist. A positive value specifies the maximum number of elements in each ziplist of a quicklist. For example, if you set this parameter to 5, each ziplist of a quicklist can contain a maximum of five elements.
  • A negative number indicates the maximum number of bytes in each ziplist of a quicklist. Valid values: [-5, -1], where:
    • -5: specifies that each ziplist of a quicklist cannot exceed 64 KB (1 KB = 1,024 bytes).
    • -4: specifies that each ziplist of a quicklist cannot exceed 32 KB.
    • -3: specifies that each ziplist of a quicklist cannot exceed 16 KB.
    • -2: specifies that each ziplist of a quicklist cannot exceed 8 KB. This is the default value.
    • -1: specifies that each ziplist of a quicklist cannot exceed 4 KB.
Supported Supported Supported
maxmemory-policy

Specifies the policy that is used to evict data when the system runs out of memory. Valid values:

  • volatile-lru: evicts the approximated least recently used (LRU) keys among keys that have time-to-live (TTL) values configured.
  • allkeys-lru: evicts the approximated LRU keys.
  • volatile-lfu: evicts the approximated least frequently used (LFU) keys among keys that have TTL values configured.
  • allkeys-lfu: evicts the approximated LFU keys.
  • volatile-random: evicts random keys among keys that have TTL values configured.
  • allkeys-random: evicts random keys.
  • volatile-ttl: evicts keys with the minimum TTL. The LRU, LFU, and volatile-ttl policies use approximated randomized algorithms.
  • noeviction: specifies that the system does not evict any keys, but returns an error for write operations.
Supported Supported Supported
notify-keyspace-events

Specifies the types of events of which the Redis server can notify clients. The value of this parameter is a combination of the following characters. Each of the following characters specifies a type of events:

  • K: keyspace events, published with the __keyspace@<db>__ prefix.
  • E: key events, published with the __keyevent@<db>__ prefix.
  • g: generic events that are not related to any specific commands, such as DEL, EXPIRE, and RENAME.
  • l: events of list commands.
  • s: events of set commands.
  • h: events of hash commands.
  • z: events of sorted set commands.
  • x: events of expired keys. An expiration event is triggered when an expired key is deleted.
  • e: the eviction events. An eviction event is triggered when a key is deleted due to the policy specified by the maxmemory-policy parameter.
  • A: the alias for g$lshzxe.
Supported Supported Supported
set-max-intset-entries

Specifies the maximum number of data entries in a set to support inset encoding. A set uses inset encoding when both of the following conditions are met:

  1. The number of entries in the set is less than or equal to the value of the set-max-intset-entries parameter.
  2. The set contains only radix-10 integers in the range of 64-bit signed integers.
Supported Supported Supported
slowlog-log-slower-than Specifies whether to log slow queries.
  • Negative value: does not log slow queries.
  • 0: logs all queries.
  • Positive value: logs queries of which the duration exceeds the specified value.

Valid values: 0 to 10000000. Default value: 10000. Unit: microseconds.

Supported Supported Supported
slowlog-max-len Specifies the maximum number of slow query logs that can be stored. Valid values: 100 to 10000. Default value: 1024. Supported Supported Supported
stream-node-max-bytes Specifies the maximum amount of memory in bytes that each macro node in a stream can consume. Valid values: 0 to 999999999999999. Unit: bytes. A value of 0 specifies that the amount of consumed memory is not limited. Supported Not supported Not supported
stream-node-max-entries Specifies the maximum number of entries stored on each macro node in a stream. Valid values: 0 to 999999999999999. A value of 0 specifies that the number of entries on each node is not limited. Supported Not supported Not supported
timeout Specifies a time-out period. The system terminates a connection to a client if the client has been idle for the specified period of time. Valid values: 0 to 100000. Unit: seconds. A value of 0 specifies that no time-out period is specified for connections. Supported Not supported Not supported
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:

  1. The number of bytes of the key or value of each key-value pair stored in the sorted set is less than the value of the zset-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the sorted set is less than the value of the zset-max-ziplist-entries parameter.
Supported Supported Supported
zset-max-ziplist-value

Specifies the maximum number of bytes of the key or value of each key-value pair stored in a sorted set. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes of the key or value of each key-value pair stored in the sorted set is less than the value of the zset-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the sorted set is less than the value of the zset-max-ziplist-entries parameter.
Supported Supported Supported
list-max-ziplist-entries

Specifies the maximum number of key-value pairs stored in a list. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes in each element stored in the list is less than the value of the list-max-ziplist-value parameter.
  2. The number of elements stored in the list is less than the value of the list-max-ziplist-entries parameter.
Not supported Not supported Not supported
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:

  1. The number of bytes in each element stored in the list is less than the value of the list-max-ziplist-value parameter.
  2. The number of elements stored in the list is less than the value of the list-max-ziplist-entries parameter.
Not supported Not supported Not supported
cluster_compat_enable Specifies whether to enable the compatibility with the native Redis cluster syntax. Valid values:
  • 0: disables the compatibility mode.
  • 1: enables the compatibility mode. This is the default value.
Not supported Supported Supported
max_session_processing Specifies the maximum number of pending requests in a single connection.

If a proxy node does not receive responses from a data node after the proxy node forwards client requests to the data node, the requests are pending. You can specify this parameter to prevent request pending that is caused by different processing capabilities of the frontend and the backend of the proxy node. This prevents an increase of memory usage.

Not supported Supported Supported
rt_threshold_ms Specifies the threshold of slow query logs for a proxy server. Unit: milliseconds. If it takes the proxy server longer than the threshold to process a request, the request is recorded in a slow query log. This time period starts when the proxy server sends a request to the data node and ends when the proxy server receives the response. Not supported Supported Supported
script_check_enable Specifies whether to verify that the keys used in Lua scripts are mapped to the same slot. Valid values:
  • 0: does not check whether the keys are mapped to the same slot.
  • 1: checks whether the keys are mapped to the same slot. This is the default value.
Not supported Supported Supported
readonly_lua_route_ronode_enable Specifies whether to enable Lua scripting on read replicas. Valid values:
  • 0: disables Lua scripting. Read replicas do not support Lua scripts. The master node processes Lua scripts. This is the default value.
  • 1: enables Lua scripting. Lua scripts that include only read requests are forwarded to read replicas.
Not supported Not supported Supported
transfer_subscrible_to_psubscrible_enable Specifies whether to enable the feature of converting SUBSCRIBE to PSUBSCRIBE. Valid values:
  • 0: disables this feature. The two commands are not interchangeable. This is the default value.
  • 1: enables this feature. Redis Proxy can convert SUBSCRIBE to PSUBSCRIBE. You can enable this feature if you run the Pub/Sub commands in Lua scripts and the channel to which you have subscribed cannot receive messages.
Not supported Supported Supported

For more information, see redis.conf for Redis 5.0.

Custom parameters of Redis 4.0

Parameter Description Standard master-replica instance Cluster master-replica instance Read/write splitting instance
#no_loose_audit-read-enabled Specifies whether to enable read request audit. After you enable this feature, logs of read requests are displayed in audit logs. Not supported Supported Supported
#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 VPC. If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC. Valid values:
  • yes: enables the system to check whether a client IP address is in a whitelist.
  • no: disables the system to check whether a client IP address is in a whitelist. This is the default value.
Supported Supported Supported
#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, based on your business requirements.
  • The commands must be written in lowercase letters. Separate multiple commands with commas (,).
Supported Supported Supported
#no_loose_ssl-enabled Specifies whether to enable SSL encryption. Valid values:
  • yes: enables SSL encryption.
  • no: disables SSL encryption. This is the default value.
Not supported Supported Supported
#no_loose_sentinel-enabled Specifies whether to enable the compatibility with the Sentinel mode. Valid values:
  • yes: enables the compatibility with the Sentinel mode.
  • no: disables the compatibility with the Sentinel mode. This is the default value.
Supported Supported Supported
#no_loose_tls-min-version Specifies the minimum TLS version supported by the instance. Valid values:
  • TLSv1
  • TLSv1.1
  • TLSv1.2
Default value: TLSv1
Not supported Supported Not supported
read_request_only_ronode_whenrwsplit_enable Specifies whether to enable directional forwarding for requests from accounts that have read-only permissions. Valid values:
  • 1: enables directional forwarding. Requests from accounts that have read-only permissions are forwarded to only read replicas.
  • 0: disables directional forwarding. Requests from accounts that have read-only permissions are forwarded to all nodes including the primary node based on weights. This is the default value.
Not supported Not supported Supported
appendonly Specifies whether to enable append-only file (AOF) persistence. Valid values:
  • yes: enables AOF persistence. This is the default value.
  • no: disables AOF persistence.
Note If you set this parameter to no, AOF persistence is disabled on the master node and remains functional on the replica node.
Supported Supported Supported
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>.
  • hard limit: disconnects a client if the output buffer of the client is larger than or equal to the value specified by the hard limit field. Unit: bytes.
  • soft limit and soft seconds: disconnects a client if the two conditions are met. One of the condition is that the output buffer of the client is larger than or equal to the value specified by the soft limit field. The other condition is that the situation lasts for a period longer than or equal to the value specified by the soft seconds field. The soft limit value is measured in bytes, and the soft seconds value is measured in seconds.
Supported Supported Supported
dynamic-hz Specifies whether to enable a dynamic hz value. Valid values:
  • yes: enables a dynamic hz value. This is the default value.
  • no: disables a dynamic hz value.
Not supported Not supported Not supported
hash-max-ziplist-entries

Specifies the maximum number of key-value pairs stored in a hash. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes of the key or value of each key-value pair stored in the hash is less than the value of the hash-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the hash is less than the value of the hash-max-ziplist-entries parameter.
Supported Supported Supported
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:

  1. The number of bytes of the key or value of each key-value pair stored in the hash is less than the value of the hash-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the hash is less than the value of the hash-max-ziplist-entries parameter.
Supported Supported Supported
hz Specifies the frequency at which Redis background tasks are performed, for example, tasks 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. A higher value results in higher CPU consumption but allows the system to delete expired keys and terminate time-out connections more frequently. We recommend that you specify a value less than or equal to 100. Supported Supported Supported
lazyfree-lazy-eviction Specifies whether to enable the eviction feature based on the lazyfree mechanism. Valid values:
  • yes: enables the feature.
  • no: disables the feature. This is the default value.
Supported Supported Supported
lazyfree-lazy-expire Specifies whether to delete expired keys based on the lazyfree mechanism. Valid values:
  • yes: enables the feature. This is the default value.
  • no: disables the feature.
Supported Supported Supported
lazyfree-lazy-server-del Specifies whether to run the DEL command and asynchronously delete data based on the lazyfree mechanism. Valid values:
  • yes: enables asynchronous deletion based on the lazyfree mechanism. This is the default value.
  • no: disables asynchronous deletion based on the lazyfree mechanism.
Supported Supported Supported
list-compress-depth

Specifies the number of entries that are not compressed at both ends of a list. Valid values: 0 to 65535.

  • 0: does not compress any node of the list. This is the default value.
  • 1: specifies that the first node from each end of the list is not compressed, but all nodes between these two nodes are compressed.
  • 2: specifies that the first two nodes from each end of the list are not compressed, but all nodes between these four nodes are compressed.
  • 3: specifies that the first three nodes from each end of the list are not compressed, but all nodes between these six nodes are compressed.
  • You can specify other values based on the same rule.
Supported Supported Supported
list-max-ziplist-size
  • The maximum length of a ziplist in a quicklist. A positive value specifies the maximum number of elements in each ziplist of a quicklist. For example, if you set this parameter to 5, each ziplist of a quicklist can contain a maximum of five elements.
  • A negative number indicates the maximum number of bytes in each ziplist of a quicklist. Valid values: [-5, -1], where:
    • -5: specifies that each ziplist of a quicklist cannot exceed 64 KB (1 KB = 1,024 bytes).
    • -4: specifies that each ziplist of a quicklist cannot exceed 32 KB.
    • -3: specifies that each ziplist of a quicklist cannot exceed 16 KB.
    • -2: specifies that each ziplist of a quicklist cannot exceed 8 KB. This is the default value.
    • -1: specifies that each ziplist of a quicklist cannot exceed 4 KB.
Supported Supported Supported
maxmemory-policy

Specifies the policy that is used to evict data when the system runs out of memory. Valid values:

  • volatile-lru: evicts the approximated least recently used (LRU) keys among keys that have time-to-live (TTL) values configured.
  • allkeys-lru: evicts the approximated LRU keys.
  • volatile-lfu: evicts the approximated least frequently used (LFU) keys among keys that have TTL values configured.
  • allkeys-lfu: evicts the approximated LFU keys.
  • volatile-random: evicts random keys among keys that have TTL values configured.
  • allkeys-random: evicts random keys.
  • volatile-ttl: evicts keys with the minimum TTL. The LRU, LFU, and volatile-ttl policies use approximated randomized algorithms.
  • noeviction: specifies that the system does not evict any keys, but returns an error for write operations.
Supported Supported Supported
notify-keyspace-events

Specifies the types of events of which the Redis server can notify clients. The value of this parameter is a combination of the following characters. Each of the following characters specifies a type of events:

  • K: keyspace events, published with the __keyspace@<db>__ prefix.
  • E: key events, published with the __keyevent@<db>__ prefix.
  • g: generic events that are not related to any specific commands, such as DEL, EXPIRE, and RENAME.
  • l: events of list commands.
  • s: events of set commands.
  • h: events of hash commands.
  • z: events of sorted set commands.
  • x: events of expired keys. An expiration event is triggered when an expired key is deleted.
  • e: the eviction events. An eviction event is triggered when a key is deleted due to the policy specified by the maxmemory-policy parameter.
  • A: the alias for g$lshzxe.
Supported Supported Supported
set-max-intset-entries

Specifies the maximum number of data entries in a set to support inset encoding. A set uses inset encoding when both of the following conditions are met:

  1. The number of entries in the set is less than or equal to the value of the set-max-intset-entries parameter.
  2. The set contains only radix-10 integers in the range of 64-bit signed integers.
Supported Supported Supported
slowlog-log-slower-than Specifies whether to log slow queries.
  • Negative value: does not log slow queries.
  • 0: logs all queries.
  • Positive value: logs queries of which the duration exceeds the specified value.

Valid values: 0 to 10000000. Default value: 10000. Unit: microseconds.

Supported Supported Supported
slowlog-max-len Specifies the maximum number of slow query logs that can be stored. Valid values: 100 to 10000. Default value: 1024. Supported Supported Supported
stream-node-max-bytes Specifies the maximum amount of memory in bytes that each macro node in a stream can consume. Valid values: 0 to 999999999999999. Unit: bytes. A value of 0 specifies that the amount of consumed memory is not limited. Not supported Not supported Not supported
stream-node-max-entries Specifies the maximum number of entries stored on each macro node in a stream. Valid values: 0 to 999999999999999. A value of 0 specifies that the number of entries on each node is not limited. Not supported Not supported Not supported
timeout Specifies a time-out period. The system terminates a connection to a client if the client has been idle for the specified period of time. Valid values: 0 to 100000. Unit: seconds. A value of 0 specifies that no time-out period is specified for connections. Supported Not supported Not supported
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:

  1. The number of bytes of the key or value of each key-value pair stored in the sorted set is less than the value of the zset-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the sorted set is less than the value of the zset-max-ziplist-entries parameter.
Supported Supported Supported
zset-max-ziplist-value

Specifies the maximum number of bytes of the key or value of each key-value pair stored in a sorted set. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes of the key or value of each key-value pair stored in the sorted set is less than the value of the zset-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the sorted set is less than the value of the zset-max-ziplist-entries parameter.
Supported Supported Supported
list-max-ziplist-entries

Specifies the maximum number of key-value pairs stored in a list. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes in each element stored in the list is less than the value of the list-max-ziplist-value parameter.
  2. The number of elements stored in the list is less than the value of the list-max-ziplist-entries parameter.
Not supported Not supported Not supported
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:

  1. The number of bytes in each element stored in the list is less than the value of the list-max-ziplist-value parameter.
  2. The number of elements stored in the list is less than the value of the list-max-ziplist-entries parameter.
Not supported Not supported Not supported
cluster_compat_enable Specifies whether to enable the compatibility with the native Redis cluster syntax. Valid values:
  • 0: disables the compatibility mode.
  • 1: enables the compatibility mode. This is the default value.
Not supported Supported Supported
max_session_processing Specifies the maximum number of pending requests in a single connection.

If a proxy node does not receive responses from a data node after the proxy node forwards client requests to the data node, the requests are pending. You can specify this parameter to prevent request pending that is caused by different processing capabilities of the frontend and the backend of the proxy node. This prevents an increase of memory usage.

Not supported Supported Supported
rt_threshold_ms Specifies the threshold of slow query logs for a proxy server. Unit: milliseconds. If it takes the proxy server longer than the threshold to process a request, the request is recorded in a slow query log. This time period starts when the proxy server sends a request to the data node and ends when the proxy server receives the response. Not supported Supported Supported
script_check_enable Specifies whether to verify that the keys used in Lua scripts are mapped to the same slot. Valid values:
  • 0: does not check whether the keys are mapped to the same slot.
  • 1: checks whether the keys are mapped to the same slot. This is the default value.
Not supported Supported Supported
readonly_lua_route_ronode_enable Specifies whether to enable Lua scripting on read replicas. Valid values:
  • 0: disables Lua scripting. Read replicas do not support Lua scripts. The master node processes Lua scripts. This is the default value.
  • 1: enables Lua scripting. Lua scripts that include only read requests are forwarded to read replicas.
Not supported Not supported Supported
transfer_subscrible_to_psubscrible_enable Specifies whether to enable the feature of converting SUBSCRIBE to PSUBSCRIBE. Valid values:
  • 0: disables this feature. The two commands are not interchangeable. This is the default value.
  • 1: enables this feature. Redis Proxy can convert SUBSCRIBE to PSUBSCRIBE. You can enable this feature if you run the Pub/Sub commands in Lua scripts and the channel to which you have subscribed cannot receive messages.
Not supported Supported Supported

For more information, see redis.conf for Redis 4.0.

Custom parameters of Redis 2.8

Parameter Description Standard master-replica instance Cluster master-replica instance Read/write splitting instance
#no_loose_audit-read-enabled Specifies whether to enable read request audit. After you enable this feature, logs of read requests are displayed in audit logs. Not supported Supported Supported
#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 VPC. If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC. Valid values:
  • yes: enables the system to check whether a client IP address is in a whitelist.
  • no: disables the system to check whether a client IP address is in a whitelist. This is the default value.
Not supported Not supported Not supported
#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, based on your business requirements.
  • The commands must be written in lowercase letters. Separate multiple commands with commas (,).
Supported Supported Supported
#no_loose_ssl-enabled Specifies whether to enable SSL encryption. Valid values:
  • yes: enables SSL encryption.
  • no: disables SSL encryption. This is the default value.
Not supported Supported Supported
#no_loose_sentinel-enabled Specifies whether to enable the compatibility with the Sentinel mode. Valid values:
  • yes: enables the compatibility with the Sentinel mode.
  • no: disables the compatibility with the Sentinel mode. This is the default value.
Not supported Not supported Not supported
#no_loose_tls-min-version Specifies the minimum TLS version supported by the instance. Valid values:
  • TLSv1
  • TLSv1.1
  • TLSv1.2
Default value: TLSv1
Not supported Supported Not supported
read_request_only_ronode_whenrwsplit_enable Specifies whether to enable directional forwarding for requests from accounts that have read-only permissions. Valid values:
  • 1: enables directional forwarding. Requests from accounts that have read-only permissions are forwarded to only read replicas.
  • 0: disables directional forwarding. Requests from accounts that have read-only permissions are forwarded to all nodes including the primary node based on weights. This is the default value.
Not supported Not supported Supported
appendonly Specifies whether to enable append-only file (AOF) persistence. Valid values:
  • yes: enables AOF persistence. This is the default value.
  • no: disables AOF persistence.
Note If you set this parameter to no, AOF persistence is disabled on the master node and remains functional on the replica node.
Supported Supported Supported
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>.
  • hard limit: disconnects a client if the output buffer of the client is larger than or equal to the value specified by the hard limit field. Unit: bytes.
  • soft limit and soft seconds: disconnects a client if the two conditions are met. One of the condition is that the output buffer of the client is larger than or equal to the value specified by the soft limit field. The other condition is that the situation lasts for a period longer than or equal to the value specified by the soft seconds field. The soft limit value is measured in bytes, and the soft seconds value is measured in seconds.
Supported Supported Supported
dynamic-hz Specifies whether to enable a dynamic hz value. Valid values:
  • yes: enables a dynamic hz value. This is the default value.
  • no: disables a dynamic hz value.
Not supported Not supported Not supported
hash-max-ziplist-entries

Specifies the maximum number of key-value pairs stored in a hash. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes of the key or value of each key-value pair stored in the hash is less than the value of the hash-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the hash is less than the value of the hash-max-ziplist-entries parameter.
Supported Supported Supported
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:

  1. The number of bytes of the key or value of each key-value pair stored in the hash is less than the value of the hash-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the hash is less than the value of the hash-max-ziplist-entries parameter.
Supported Supported Supported
hz Specifies the frequency at which Redis background tasks are performed, for example, tasks 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. A higher value results in higher CPU consumption but allows the system to delete expired keys and terminate time-out connections more frequently. We recommend that you specify a value less than or equal to 100. Supported Supported Supported
lazyfree-lazy-eviction Specifies whether to enable the eviction feature based on the lazyfree mechanism. Valid values:
  • yes: enables the feature.
  • no: disables the feature. This is the default value.
Not supported Not supported Not supported
lazyfree-lazy-expire Specifies whether to delete expired keys based on the lazyfree mechanism. Valid values:
  • yes: enables the feature. This is the default value.
  • no: disables the feature.
Not supported Not supported Not supported
lazyfree-lazy-server-del Specifies whether to run the DEL command and asynchronously delete data based on the lazyfree mechanism. Valid values:
  • yes: enables asynchronous deletion based on the lazyfree mechanism. This is the default value.
  • no: disables asynchronous deletion based on the lazyfree mechanism.
Not supported Not supported Not supported
list-compress-depth

Specifies the number of entries that are not compressed at both ends of a list. Valid values: 0 to 65535.

  • 0: does not compress any node of the list. This is the default value.
  • 1: specifies that the first node from each end of the list is not compressed, but all nodes between these two nodes are compressed.
  • 2: specifies that the first two nodes from each end of the list are not compressed, but all nodes between these four nodes are compressed.
  • 3: specifies that the first three nodes from each end of the list are not compressed, but all nodes between these six nodes are compressed.
  • You can specify other values based on the same rule.
Not supported Not supported Not supported
list-max-ziplist-size
  • The maximum length of a ziplist in a quicklist. A positive value specifies the maximum number of elements in each ziplist of a quicklist. For example, if you set this parameter to 5, each ziplist of a quicklist can contain a maximum of five elements.
  • A negative number indicates the maximum number of bytes in each ziplist of a quicklist. Valid values: [-5, -1], where:
    • -5: specifies that each ziplist of a quicklist cannot exceed 64 KB (1 KB = 1,024 bytes).
    • -4: specifies that each ziplist of a quicklist cannot exceed 32 KB.
    • -3: specifies that each ziplist of a quicklist cannot exceed 16 KB.
    • -2: specifies that each ziplist of a quicklist cannot exceed 8 KB. This is the default value.
    • -1: specifies that each ziplist of a quicklist cannot exceed 4 KB.
Not supported Not supported Not supported
maxmemory-policy

Specifies the policy that is used to evict data when the system runs out of memory. Valid values:

  • volatile-lru: evicts the approximated least recently used (LRU) keys among keys that have time-to-live (TTL) values configured.
  • allkeys-lru: evicts the approximated LRU keys.
  • volatile-lfu: evicts the approximated least frequently used (LFU) keys among keys that have TTL values configured.
  • allkeys-lfu: evicts the approximated LFU keys.
  • volatile-random: evicts random keys among keys that have TTL values configured.
  • allkeys-random: evicts random keys.
  • volatile-ttl: evicts keys with the minimum TTL. The LRU, LFU, and volatile-ttl policies use approximated randomized algorithms.
  • noeviction: specifies that the system does not evict any keys, but returns an error for write operations.
Supported Supported Supported
notify-keyspace-events

Specifies the types of events of which the Redis server can notify clients. The value of this parameter is a combination of the following characters. Each of the following characters specifies a type of events:

  • K: keyspace events, published with the __keyspace@<db>__ prefix.
  • E: key events, published with the __keyevent@<db>__ prefix.
  • g: generic events that are not related to any specific commands, such as DEL, EXPIRE, and RENAME.
  • l: events of list commands.
  • s: events of set commands.
  • h: events of hash commands.
  • z: events of sorted set commands.
  • x: events of expired keys. An expiration event is triggered when an expired key is deleted.
  • e: the eviction events. An eviction event is triggered when a key is deleted due to the policy specified by the maxmemory-policy parameter.
  • A: the alias for g$lshzxe.
Supported Supported Supported
set-max-intset-entries

Specifies the maximum number of data entries in a set to support inset encoding. A set uses inset encoding when both of the following conditions are met:

  1. The number of entries in the set is less than or equal to the value of the set-max-intset-entries parameter.
  2. The set contains only radix-10 integers in the range of 64-bit signed integers.
Supported Supported Supported
slowlog-log-slower-than Specifies whether to log slow queries.
  • Negative value: does not log slow queries.
  • 0: logs all queries.
  • Positive value: logs queries of which the duration exceeds the specified value.

Valid values: 0 to 10000000. Default value: 10000. Unit: microseconds.

Supported Supported Supported
slowlog-max-len Specifies the maximum number of slow query logs that can be stored. Valid values: 100 to 10000. Default value: 1024. Supported Supported Supported
stream-node-max-bytes Specifies the maximum amount of memory in bytes that each macro node in a stream can consume. Valid values: 0 to 999999999999999. Unit: bytes. A value of 0 specifies that the amount of consumed memory is not limited. Not supported Not supported Not supported
stream-node-max-entries Specifies the maximum number of entries stored on each macro node in a stream. Valid values: 0 to 999999999999999. A value of 0 specifies that the number of entries on each node is not limited. Not supported Not supported Not supported
timeout Specifies a time-out period. The system terminates a connection to a client if the client has been idle for the specified period of time. Valid values: 0 to 100000. Unit: seconds. A value of 0 specifies that no time-out period is specified for connections. Not supported Not supported Not supported
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:

  1. The number of bytes of the key or value of each key-value pair stored in the sorted set is less than the value of the zset-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the sorted set is less than the value of the zset-max-ziplist-entries parameter.
Supported Supported Supported
zset-max-ziplist-value

Specifies the maximum number of bytes of the key or value of each key-value pair stored in a sorted set. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes of the key or value of each key-value pair stored in the sorted set is less than the value of the zset-max-ziplist-value parameter.
  2. The number of key-value pairs stored in the sorted set is less than the value of the zset-max-ziplist-entries parameter.
Supported Supported Supported
list-max-ziplist-entries

Specifies the maximum number of key-value pairs stored in a list. The ziplist encoding is used only if both of the following conditions are met:

  1. The number of bytes in each element stored in the list is less than the value of the list-max-ziplist-value parameter.
  2. The number of elements stored in the list is less than the value of the list-max-ziplist-entries parameter.
Supported Supported Supported
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:

  1. The number of bytes in each element stored in the list is less than the value of the list-max-ziplist-value parameter.
  2. The number of elements stored in the list is less than the value of the list-max-ziplist-entries parameter.
Supported Supported Supported
cluster_compat_enable Specifies whether to enable the compatibility with the native Redis cluster syntax. Valid values:
  • 0: disables the compatibility mode.
  • 1: enables the compatibility mode. This is the default value.
Not supported Supported Supported
max_session_processing Specifies the maximum number of pending requests in a single connection.

If a proxy node does not receive responses from a data node after the proxy node forwards client requests to the data node, the requests are pending. You can specify this parameter to prevent request pending that is caused by different processing capabilities of the frontend and the backend of the proxy node. This prevents an increase of memory usage.

Not supported Supported Supported
rt_threshold_ms Specifies the threshold of slow query logs for a proxy server. Unit: milliseconds. If it takes the proxy server longer than the threshold to process a request, the request is recorded in a slow query log. This time period starts when the proxy server sends a request to the data node and ends when the proxy server receives the response. Not supported Supported Supported
script_check_enable Specifies whether to verify that the keys used in Lua scripts are mapped to the same slot. Valid values:
  • 0: does not check whether the keys are mapped to the same slot.
  • 1: checks whether the keys are mapped to the same slot. This is the default value.
Not supported Supported Supported
readonly_lua_route_ronode_enable Specifies whether to enable Lua scripting on read replicas. Valid values:
  • 0: disables Lua scripting. Read replicas do not support Lua scripts. The master node processes Lua scripts. This is the default value.
  • 1: enables Lua scripting. Lua scripts that include only read requests are forwarded to read replicas.
Not supported Not supported Supported
transfer_subscrible_to_psubscrible_enable Specifies whether to enable the feature of converting SUBSCRIBE to PSUBSCRIBE. Valid values:
  • 0: disables this feature. The two commands are not interchangeable. This is the default value.
  • 1: enables this feature. Redis Proxy can convert SUBSCRIBE to PSUBSCRIBE. You can enable this feature if you run the Pub/Sub commands in Lua scripts and the channel to which you have subscribed cannot receive messages.
Not supported Not supported Not supported

For more information, see redis.conf for Redis 2.8.

Modify parameters in the ApsaraDB for Redis console

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the Instance ID of the instance.
  4. In the left-side navigation pane, click System Parameters.
  5. On the System Parameters page, find the parameter that you want to modify, and click Modify in the Actions column.Modify parameters
  6. In the dialog box that appears, change the parameter value.
    Warning After you submit the modification for some parameters, the instance is automatically restarted. Transient connection errors occur on the instance during the instance restart. Modify parameters with caution. Before you modify a parameter, you can check whether the instance needs to be restarted after parameter modification in the Restart and Take Effect column of the parameter.
  7. Click OK.

FAQ

  • Can I modify the maxclients parameter?

    No, you cannot modify the maxclients parameter. The maxclients parameter is used to specify the maximum number of concurrent connections to an ApsaraDB for Redis data node. Except for performance-enhanced instances of ApsaraDB for Redis Enhanced Edition, the default value of maxclients is 10000. To increase the maximum number of concurrent connections, you can scale out the instances.

  • What is a zone-disaster recovery instance?

    When you create an ApsaraDB for Redis instance, if you select the zone where zone-disaster recovery is supported,such as US East 1 Mzone1 A+B, a zone-disaster recovery instance is created. For more information, see Zone-disaster recovery.