Updated on 2025-09-02 GMT+08:00

Creating a Custom Parameter Template for a DCS Instance

System default parameter templates vary by Redis version and instance type. A system default parameter template contains default instance parameter configurations. Parameter templates can be customized for parameter configurations, and can be selected in instance creation.

This section describes how to create and modify a custom parameter template on the DCS console.

Procedure

  1. Log in to the DCS console.
  2. Click in the upper left corner of the console and select the region where your instance is located.
  3. In the navigation pane, choose Parameter Templates.
  4. Click the Default Templates or Custom Templates tab to create a template based on a default template or an existing custom template.

    • If you select Default Templates, click Customize in the Operation column of the row containing the desired cache engine version.
    • If you select Custom Templates, click Copy in the Operation column in the row containing the desired custom template.

  5. Specify Template Name and Description.

    The template name can contain 4 to 64 characters and must start with a letter or digit. Only letters, digits, hyphens (-), underscores (_), and periods (.) are allowed. The description can be empty.

  6. Select Modifiable parameters.

    Currently, you can enter a keyword in the search box to search for a parameter by parameter name.

  7. In the row that contains the parameter to be modified, enter a value in the Assigned Value column.

    Table 1 describes the parameters. In most cases, default values are retained.

    Table 1 DCS Redis instance configuration parameters

    Parameter

    Description

    Exception Scenario

    Value Range

    Default Value

    active-expire-num

    Number of randomly checked keys in regular expired key deletions.

    Enlarging this parameter may increase CPU usage or command latency in a short period of time. Lessening this parameter may increase expired keys in the memory.

    This parameter is not available for DCS Redis 3.0 and 6.0 professional edition instances.

    NOTE:

    This parameter was added in September 2021. If the parameter value cannot be changed for instances created before September 2021, submit a ticket and contact customer service.

    1–1000

    20

    timeout

    The maximum amount of time (in seconds) a connection between a client and the DCS instance can be allowed to remain idle before the connection is terminated. The value 0 indicates that the parameter is disabled. That is, the client is not disconnected when it is idle.

    -

    0–7,200

    Unit: second

    0

    appendfsync

    Controls how often fsync() transfers cached data to the disk. Note that some OSs will perform a complete data transfer but some others only make a "best-effort" attempt.

    Single-node instances do not have this parameter.

    • no: fsync() is never called. The OS will flush data when it is ready. This mode offers the highest performance.
    • always: fsync() is called after every write to the AOF. This mode is very slow, but also very safe.
    • everysec: fsync() is called once per second. This mode provides a compromise between safety and performance.

    no

    appendonly

    Indicates whether to log each modification of the instance. By default, data is written to disks asynchronously in Redis. If the logging (data persistence) is disabled, recently-generated data might be lost in the event of a power failure.

    Single-node instances do not have this parameter.

    Available in master/standby or cluster DCS Redis 4.0 and later basic edition or master/standby enterprise (performance) edition instances.

    If this parameter is not displayed on the console, submit a ticket and contact customer service to allow the configuration item.

    • yes: Logs are enabled, that is, data persistence is enabled.
    • no: Logs are disabled, that is, data persistence is disabled.
    • only-replica: Enable data persistence only on replica nodes.
      CAUTION:

      When parameter appendonly of a master/standby or read/write splitting instance is set to only-replica, the master/standby switchover priority of all replica nodes cannot be set to 0 (100: default; 0: disabled). Otherwise, data persistence will be automatically enabled on the master node.

    yes

    client-output-buffer-limit-slave-soft-seconds

    When the client-output-buffer-slave-soft-limit parameter is exceeded for more than the value of this parameter, the server drops the connection. The smaller the value, the easier the disconnection.

    Single-node instances do not have this parameter.

    0–60

    Unit: second

    60

    client-output-buffer-slave-hard-limit

    Hard limit on the output buffer of replica clients. Once the output buffer exceeds the hard limit, the client is immediately disconnected. The smaller the value, the easier the disconnection.

    Single-node instances do not have this parameter.

    0–17,179,869,184

    Unit: byte

    1,717,986,918

    client-output-buffer-slave-soft-limit

    Soft limit on the output buffer of replica clients. Once the output buffer exceeds the soft limit and continuously remains above the limit for the time specified by the client-output-buffer-limit-slave-soft-seconds parameter, the client is disconnected. The smaller the value, the easier the disconnection.

    Single-node instances do not have this parameter.

    0–17,179,869,184

    Unit: byte

    1,717,986,918

    maxmemory-policy

    The policy applied when the maxmemory limit is reached. 8 values are available.

    -

    • volatile-lru: Evict keys by trying to remove the less recently used (LRU) keys first, but only among keys that have an expire set.
    • allkeys-lru: Evict keys by trying to remove the LRU keys first.
    • volatile-random: Evict keys randomly, but only among keys that have an expire set.
    • allkeys-random: Evict keys randomly.
    • volatile-ttl: Evict keys with an expire set, and try to evict keys with a shorter time to live (TTL) first.
    • noeviction: Do not delete any keys and only return errors when the memory limit was reached.
    • volatile-lfu: Evict keys by trying to remove the less frequently used (LFU) keys first, but only among keys that have an expire set.
    • allkeys-lfu: Evict keys by trying to remove the LFU keys first.

    For details about eviction policies, see the Redis official website.

    volatile-lru

    NOTE:

    If the DCS Redis instance is created before July 2020 and this parameter has not been modified, the default value is noeviction. If the instance is created after July 2020, the default value is volatile-lru.

    lua-time-limit

    Maximum time allowed for executing a Lua script.

    -

    100–5,000

    Unit: millisecond

    5,000

    master-read-only

    Sets the instance to be read-only. All write operations will fail.

    Proxy Cluster instances do not have this parameter.

    • yes
    • no

    no

    maxclients

    The maximum number of clients allowed to be concurrently connected to a DCS instance. The larger the value, the more costly the connection to the server, which affects the server performance and increases the command latency. An excessively small value may constrain the server performance.

    This parameter specifies the maximum number of connections on a single node (single shard).

    • Cluster: Maximum connections per node = Maximum connections of the instance/Shard quantity
    • Single-node and master/standby: Maximum connections on a single node = Maximum connections of the instance

    Read/Write splitting instances do not support this parameter.

    1000–50,000

    10,000

    proto-max-bulk-len

    Maximum size of a single element request. Set this parameter to be greater than the customer request length. Otherwise, the request cannot be executed.

    -

    1,048,576–536,870,912

    Unit: byte

    536,870,912

    repl-backlog-size

    The replication backlog size. The backlog is a buffer that accumulates replica data when replicas are disconnected from the master. When a replica reconnects, a partial synchronization is performed to synchronize the data that was missed while replicas were disconnected.

    -

    16,384–1,073,741,824

    Unit: byte

    1,048,576

    repl-backlog-ttl

    The amount of time, in seconds, before the backlog buffer is released, starting from the last a replica was disconnected. The value 0 indicates that the backlog is never released.

    -

    0–604,800

    Unit: second

    3,600

    repl-timeout

    Replication timeout.

    Single-node instances do not have this parameter.

    30–3,600

    Unit: second

    60

    hash-max-ziplist-entries

    The maximum number of hashes that can be encoded using ziplist, a data structure optimized to reduce memory use.

    -

    1–10,000

    512

    hash-max-ziplist-value

    The largest value allowed for a hash encoded using ziplist, a special data structure optimized for memory use.

    -

    1–10,000

    64

    set-max-intset-entries

    When a set is composed entirely of strings and number of integer elements is less than this parameter value, the set is encoded using intset, a data structure optimized for memory use.

    -

    1–10,000

    512

    zset-max-ziplist-entries

    The maximum number of sorted sets that can be encoded using ziplist, a data structure optimized to reduce memory use.

    -

    1–10,000

    128

    zset-max-ziplist-value

    The largest value allowed for a sorted set encoded using ziplist, a special data structure optimized for memory use.

    -

    1–10,000

    64

    latency-monitor-threshold

    The minimum amount of latency that will be logged as latency spikes

    If this parameter is set to 0, latency monitoring is disabled. If this parameter is set to a value greater than 0, all events blocking the server for a time greater than the configured value will be logged.

    To obtain statistics data, and configure and enable latency monitoring, run the LATENCY command.

    CAUTION:

    The latency-monitor-threshold parameter is usually used for fault location. After locating faults based on the latency information collected, change the value of latency-monitor-threshold to 0 to avoid unnecessary latency.

    Proxy Cluster instances do not have this parameter.

    0–86,400,000

    Unit: millisecond

    0

    notify-keyspace-events

    Controls which keyspace events notifications are enabled for. If this parameter is configured, the Redis Pub/Sub feature will allow clients to receive an event notification when a Redis data set is modified. Leaving this parameter blank disables the function. Specifying this parameter with a non-null string enables the function.

    Proxy Cluster instances do not have this parameter.

    A combination of different values can be used to enable notifications for multiple event types. Possible values include:

    K: Keyspace events, published with the __keyspace@*__ prefix

    E: Keyevent events, published with __keyevent@*__ prefix

    g: Generic commands (non-type specific) such as DEL, EXPIRE, and RENAME

    $: 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 from maxmemory)

    A: an alias for "g$lshzxe"

    The parameter value must contain either K or E. A cannot be used together with any of the characters in "g$lshzxe". For example, the value Kl means that Redis will notify Pub/Sub clients about keyspace events and list commands. The value AKE means Redis will notify Pub/Sub clients about all events.

    Ex

    slowlog-log-slower-than

    Slow queries cover scheduled commands whose execution is delayed. slowlog-log-slower-than is the maximum time allowed for command execution. If this threshold is exceeded, Redis will record the query.

    -

    0–1,000,000

    Unit: microsecond

    10,000

    proxy-slowlog-log-slower-than

    Slow queries of a proxy cover scheduled commands whose execution is delayed. proxy-slowlog-log-slower-than is the maximum time allowed for command execution. If this threshold is exceeded, the proxy will record the query.

    Currently, only Proxy Cluster and read/write splitting instances in the CN East-Shanghai2 and CN South-Guangzhou regions.

    30,000–2,000,000

    Unit: microsecond

    256,000

    slowlog-max-len

    The maximum allowed number of slow queries that can be logged. Slow query log consumes memory, but you can reclaim this memory by running the SLOWLOG RESET command.

    -

    0–1000

    128

    proxy-slowlog-max-len

    The maximum allowed number of slow queries of a proxy that can be logged. Slow query log consumes memory, but you can reclaim this memory by running the SLOWLOG RESET command.

    Currently, only Proxy Cluster and read/write splitting instances in the CN East-Shanghai2 and CN South-Guangzhou regions.

    0–1000

    128

    multi-db

    Enables or disables the multiple database feature. Manually back up the instance and clear all instance data before you enable or disable this option. Cleared data can be restored by importing backup files on the Data Migration page.

    For details about restrictions on enabling multi-DB for a Proxy Cluster, see Notes and Procedure for Enabling Multi-DB for Proxy Cluster Instances.

    Only Proxy Cluster DCS Redis 4.0 and later instances have this parameter.

    • yes: enabled
    • no: disabled

    no

    auto-kill-timeout-lua-process

    When this parameter is enabled, processes running the lua script are killed when their execution times out. However, scripts with write operations are not killed, but their nodes automatically restart (if persistence has been enabled for the instance) without saving the write operations.

    Single-node instances and DCS Redis 3.0 instances do not have this parameter.

    • yes: enabled
    • no: disabled

    no

    audit-log-customer-command-list

    Commands to record in audit logs (only write commands are recorded by default.) This parameter is valid only when the audit log function is enabled.

    Viewing Audit Logs of a DCS Redis Instance is available only in certain regions. This parameter is displayed only for Proxy Cluster instances when the audit log feature is supported.

    A maximum of 10 commands are allowed. For each command, use up to 10 characters including letters, periods (.), hyphens (-), and underscores (_), and start and end with a letter. Separate multiple commands with spaces, and end your input with a space.

    -

    backend-master-only

    Read/Write splitting is disabled by default for Proxy Cluster instances. In this case, read and write requests are allocated to the master node of a Proxy Cluster instance. A Proxy Cluster instance with read/write splitting enabled allocates write requests to the master node, and read requests to the replica node by default.

    When read-only-slave-when-wr-split is set to no, read requests are evenly distributed to the master and replica nodes in the Proxy Cluster.

    Only Proxy Cluster instances have this parameter.

    • yes: disables read/write splitting.
    • no: enables read/write splitting.

    yes

    read-only-slave-when-wr-split

    Valid only when read/write splitting is enabled for a Proxy Cluster or read/write splitting instance. (Read/Write splitting is enabled for read/write splitting instances by default. To enable it for a Proxy Cluster instance, set backend-master-only to no.)

    A Proxy Cluster instance or a read/write splitting one with read/write splitting enabled performs reads only on the replica node by default. Reads can be performed on both the master and replica nodes as configured.

    Available only for Proxy Cluster and read/write splitting DCS Redis 4.0 and later instances.

    yes: Read only on replica nodes.

    no: Read on both master and replica nodes.

    yes

    support-dispatch-to-replica-list

    Evenly allocates specified read commands to slave nodes. Currently, only the KEYS command can be configured.

    Available only for Proxy Cluster or read/write splitting instances whose proxy version is 5.0.14.12 or later.

    Left blank by default. Setting this parameter to KEYS performs the KEYS command only on the slave node.

    -

    dispatch-pubsub-to-fixed-shard

    This parameter specifies whether pub/sub channels are on the shard of slot 0. When this parameter is enabled, the pub/sub processing logic is consistent with that of single-node instances. You are advised to enable this parameter if you do not depend heavily on pub/sub. If you depend heavily on pub/sub, use the default configuration to allocate subscriptions to all shards.

    Only Proxy Cluster instances have this parameter.

    • yes: Enable this parameter to allocate subscription channels to the shard of slot 0.
    • no: Disable this parameter to allocate channels to the shard of each channel-hashed slot.

    no

    readonly-lua-route-to-slave-enabled

    If enabled, read-only Lua scripts of read-only users are executed and routed to the standby node.

    Only read/write splitting instances support this parameter.

    • yes: enabled
    • no: disabled

    no

    cluster-sentinel-enabled

    To support Sentinels for the instance.

    Only Proxy Cluster instances have this parameter.

    • yes: enabled
    • no: disabled

    no

    scan-support-wr-split

    The SCAN command is executed on the master node when this parameter is disabled, or is executed on the replica node otherwise.

    Enabling this parameter relieves SCAN commands on the master node. But newly written data in the master node may not be synchronized to replicas in time.

    Only Proxy Cluster instances have this parameter.

    Proxy Cluster instances created earlier may not support this parameter. In this case, submit a ticket and contact customer service to upgrade instances.

    • yes: enabled
    • no: disabled

    no

    1. The default values and value ranges of the maxclients, reserved-memory-percent, client-output-buffer-slave-soft-limit, and client-output-buffer-slave-hard-limit parameters are related to the instance specifications. Therefore, these parameters are not displayed in the parameter template.
    2. For more information about the parameters described in Table 1, visit https://redis.io/topics/memory-optimization.

  8. Click OK.

Modifying or Deleting Custom Templates

  1. Log in to the DCS console.
  2. Click in the upper left corner of the console and select the region where your instance is located.
  3. In the navigation pane, choose Parameter Templates.
  4. Choose the Custom Templates tab.
  5. To edit a custom parameter template, use either of the following ways:

    • Locate the row containing the desired template and click Edit in the Operation column.
      1. Change the name or modify the description.
      2. In the Parameters area, select Modifiable parameters. In the row containing the desired parameter, enter a value in the Assigned Value column. Table 1 describes the parameters. In most cases, retain the default values.
      3. Click OK.
    • Click the name of a custom template.
      1. Select Modifiable parameters. Enter a keyword in the search box to search for a parameter by its name.
      2. Click Modify.
      3. In the row containing the desired parameter, enter a value in the Assigned Value column. Table 1 describes the parameters. In most cases, retain the default values.
      4. Click Save.

  6. To delete custom templates, click Delete in the Operation column on the right of the templates to be deleted.

    Click Yes.