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 Master-replica cluster 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) network. If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC network. Valid values:
  • yes: specifies that the system checks 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 that you want to disable, including FLUSHALL, FLUSHDB, KEYS, HGETALL, EVAL, EVALSHA, and SCRIPT. 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 system to check whether a client IP address is in a whitelist. This is the default value.
Supported Supported 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 only forwarded to read replicas.
  • 0: disables directional forwarding. Requests from accounts that have read-only permissions are forwarded 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 output buffer of the client is larger than or equal to the value specified by the soft limit field and if this 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 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 timeout connections more frequently. We recommend that you specify a value smaller 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 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

The types of events of which the Redis server can notify clients. The value of this parameter is any combination of the following characters, each of which 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 Not supported Not supported
set-max-intset-entries

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 only contains 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 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 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 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 timeout 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 timeout 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 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 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
rt_threshold_ms 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 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 use 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 Master-replica cluster 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) network. If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC network. Valid values:
  • yes: specifies that the system checks 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 that you want to disable, including FLUSHALL, FLUSHDB, KEYS, HGETALL, EVAL, EVALSHA, and SCRIPT. 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
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 only forwarded to read replicas.
  • 0: disables directional forwarding. Requests from accounts that have read-only permissions are forwarded 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 output buffer of the client is larger than or equal to the value specified by the soft limit field and if this 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 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 timeout connections more frequently. We recommend that you specify a value smaller 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 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

The types of events of which the Redis server can notify clients. The value of this parameter is any combination of the following characters, each of which 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 Not supported Not supported
set-max-intset-entries

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 only contains 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 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 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 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 timeout 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 timeout 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 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 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
rt_threshold_ms 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 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 use 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 Master-replica cluster 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) network. If you set this parameter to yes, the whitelist still takes effect for password-free access over a VPC network. Valid values:
  • yes: specifies that the system checks whether a client IP address is in a whitelist.
  • no: disables the compatibility with the Sentinel mode. This is the default value.
Not supported Not supported Not supported
#no_loose_disabled-commands

Specifies the commands that you want to disable, including FLUSHALL, FLUSHDB, KEYS, HGETALL, EVAL, EVALSHA, and SCRIPT. 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
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 only forwarded to read replicas.
  • 0: disables directional forwarding. Requests from accounts that have read-only permissions are forwarded 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 output buffer of the client is larger than or equal to the value specified by the soft limit field and if this 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 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 timeout connections more frequently. We recommend that you specify a value smaller 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 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

The types of events of which the Redis server can notify clients. The value of this parameter is any combination of the following characters, each of which 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 Not supported Not supported
set-max-intset-entries

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 only contains 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 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 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 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 timeout 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 means that no timeout 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 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 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
rt_threshold_ms 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 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 use 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. In the top navigation bar, select the region where the target instance is located.
  3. On the Instances page, click the Instance ID of the target instance.
  4. In the left-side navigation pane of the Instance Information page, click System Parameters.
  5. On the System Parameters page, find the parameter that you want to set and click Modify in the Actions column.
  6. In the dialog box that appears, modify the parameter value and click OK.

Call API operations to set parameters

You can also call the ModifyInstanceConfig operation to set parameters.

Related operations

API Description
DescribeParameters Queries configuration parameters and running parameters of an ApsaraDB for Redis instance.
ModifyInstanceConfig Modifies configuration parameters of an ApsaraDB for Redis instance.

FAQ

  • Can I modify the maxclients parameter?

    The value of maxclients is used to specify the maximum number of concurrent connections to an ApsaraDB for Redis data node. You cannot change the value of maxclients. 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 zones where zone-disaster recovery is supported, for example, or US (Virginia) Zones A + B, a zone-disaster recovery instance is created. For more information, see Zone-disaster recovery.