Parameter Configuration

Last updated: 2021-07-08 15:15:31

    This document describes how to modify parameters of TencentDB for Redis instances in the console.

    Overview

    Some of the parameters of TencentDB for Redis instances can be customized. In the console, you can view and modify these parameters and view their modification history.

    Note:

    To ensure instance stability, only some parameters can be modified in the console. These parameters are displayed on the Parameter Configuration page.

    Modifying Parameters

    Modifying one parameter

    1. Log in to the TencentDB for Redis console and click an instance ID in the instance list to enter the instance management page.
    2. On the Parameter Configuration > Modifiable Parameters tab on the instance management page, locate the desired parameter in the parameter list and click in the Current Value column.
    3. Modify the value within the restrictions stated in the Acceptable Values column and click to save the modification. You can click to cancel the modification.

    Batch modifying parameters

    1. Log in to the TencentDB for Redis console and click an instance ID in the instance list to enter the instance management page.
    2. On the instance management page, select the Parameter Configuration tab and click Modify Current Value.
    3. Locate the desired parameters and modify their values in the Current Value column. After confirming that everything is correct, click OK.

    Viewing Parameter Modification Log

    1. Log in to the TencentDB for Redis console and click an instance ID in the instance list to enter the instance management page.
    2. View the parameter modification history in Parameter Configuration > Modification Log.

    Supported Custom Parameters

    ParameterDescriptionSupported Version
    disable-command-list Disable commands that have high time complexity or are highly risky. The disabled commands will not be allowed to run in this instance. To disable multiple commands, separate them with commas, such as `flushdb,keys`. Redis 2.8、4.0、5.0
    maxmemory-policy Select one of the following eviction policies used to evict data when the Redis in-memory cache was used up.
  • volatile-lru: evict keys with an expire set by trying to remove the less recently used (LRU) keys first.
  • allkeys-lru: evict keys by trying to remove the less recently used (LRU) keys first.
  • volatile-random: randomly evict keys with an expire set.
  • allkeys-random: randomly evict keys.
  • volatile-ttl: evict keys with an expire set, and try to evict keys with a shorter time to live (TTL) first.
  • noeviction: do not evict keys but return errors when the memory limit was reached.
    LRU and TTL are implemented by randomized and approximation algorithms.
  • Redis2.8、4.0、5.0
    cluster-node-timeout Set the timeout threshold for a cluster node. If a cluster node remains unreachable longer than the threshold, it will be deemed as a failed node. Redis4.0、5.0
    hash-max-ziplist-entries Hashes that meet both of the following conditions will be encoded as ziplist.
  • The biggest hash entry is smaller than the value (in bytes) of `hash-max-ziplist-value`.
  • The number of hash entries is smaller than the value of `hash-max-ziplist-entries`.
  • Redis2.8、4.0、5.0
    hash-max-ziplist-value Hashes that meet both of the following conditions will be encoded as ziplist.
  • The biggest hash entry is smaller than the value (in bytes) of `hash-max-ziplist-value`.
  • The number of hash entries is smaller than the value of `hash-max-ziplist-entries`.
  • Redis2.8、4.0、5.0
    proxy-slowlog-log-slower-than Set the slow query threshold (in microseconds) in proxy. In proxy, queries that are executed longer than the threshold will be logged. Redis2.8、4.0、5.0
    set-max-intset-entries Sets that meet both of the following conditions will be encoded as intset.
  • All set members are composed of just strings.
  • All set members can be interpreted as base-10 integers within the range of 64-bit signed integers.
  • Redis2.8、4.0、5.0
    slowlog-log-slower-than Set the slow query threshold (in microseconds). Queries that are executed longer than the threshold will be logged. Redis2.8、4.0、5.0
    timeout Set the timeout threshold (in seconds) for connections. Client connections that remain idle longer than the threshold will be closed. Redis2.8、4.0、5.0
    zset-max-ziplist-entries Sorted sets that meet both of the following conditions will be encoded as ziplist.
  • The biggest sorted set element is smaller than the value (in bytes) of `zset-max-ziplist-value`.
  • The number of sorted set elements is smaller than the value of `zset-max-ziplist-entries`.
  • Redis2.8、4.0、5.0
    zset-max-ziplist-value Sorted sets that meet both of the following conditions will be encoded as ziplist.
  • The biggest sorted set element is smaller than the value (in bytes) of `zset-max-ziplist-value`.
  • The number of sorted set elements is smaller than the value of `zset-max-ziplist-entries`.
  • Redis2.8、4.0、5.0
    notify-keyspace-events Specify the type of notifications sent by the server. The value of this parameter is composed of multiple characters listed as follows:
  • Character: notification type
  • K: keyspace events, published with `__keyspace@&dxlt;db>__` prefix.
  • E: keyevent events, published with `__keyevent@&dxlt;db>__` prefix.
  • g: generic commands (non-type specific) like DEL, EXPIRE, RENAME, etc.
  • $: string commands
  • l: list commands
  • s: set commands
  • h: hash commands
  • z: sorted set commands
  • x: expired events (events generated every time a key expires)
  • e: evicted events (events generated when a key is evicted for maxmemory)
  • A: alias for `g$lshzxe`
    Enabling keyspace event notifications consumes CPU resources, so this type of notification is disabled by default. To configure the server to send notifications, the parameter value must include `K` or `E`. For example, to subscribe to evicted event notifications of the keyevent events, set the parameter to `Ee`; to subscribe to all types of notifications, set the parameter to `AKE`.
  • Redis2.8、4.0、5.0
    list-max-ziplist-entries Lists that meet both of the following conditions will be encoded as ziplist.
  • The biggest list element is smaller than the value (in bytes) of `list-max-ziplist-value`.
  • The number of list elements is smaller than the value of `list-max-ziplist-entries`.
  • Redis2.8
    list-max-ziplist-value Lists that meet both of the following conditions will be encoded as ziplist.
  • The biggest list element is smaller than the value (in bytes) of `list-max-ziplist-value`.
  • The number of list elements is smaller than the value of `list-max-ziplist-entries`.
  • Redis2.8