Updated on 2024-06-20 GMT+08:00

Modifying Configuration Parameters in Batches

On the DCS console, you can configure multiple parameters at a time for an instance to achieve optimal DCS performance.

Modifying instance configuration parameters takes immediate effect without requiring a manual restart. In the case of a cluster instance, the changes apply to all shards.

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 Cache Manager.
  4. On the Cache Manager page, select all DCS instances you want to configure.
  5. Choose More > Modify Parameters.

    • The parameters displayed on the Modify Parameters page are the union set of the parameters of the selected instances. For example, assume that the appendfsync parameter of instance 1 is not supported by instance 2. You can still select this parameter, but the system displays a message in 7 indicating that instance 2 does not support this parameter. After the submission, the modification command will not be delivered to instance 2. The parameter value range is the intersection of the parameter value ranges of the selected instances. For example, if the value range is 0 to 50,000 for instance 1, and 1000 to 50,000 for instance 2, the value range displayed on the page is 1000 to 50,000.
    • If you do not want to modify a selected instance, click next to it.

  6. Select the parameter to be modified and enter a new value in the New Value column.

    Table 1 and Table 2 describe the parameters. In most cases, you can retain default values.

    Table 1 DCS Redis instance configuration parameters

    Parameter

    Description

    Value Range

    Default Value

    active-expire-num

    Number of expired keys that can be deleted in regular scans.

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

    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. A setting of 0 means that this function is disabled.

    Proxy Cluster instances do not have this parameter.

    0–7200 seconds

    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.

    There are three settings:

    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
    • always
    • everysec

    no

    appendonly

    Indicates whether to log each modification of the instance. By default, data is written to disks asynchronously in Redis. If this function is disabled, recently-generated data might be lost in the event of a power failure. Single-node instances do not have this parameter.

    Options:

    yes: Logs are enabled, that is, persistence is enabled.

    no: Logs are disabled, that is, persistence is disabled.

    only-replica: Enable persistence only on replica nodes.

    NOTE:

    By default, the appendonly parameter can only be set to yes or no. To set it to only-replica for a basic edition master/standby or cluster DCS Redis 4.0/5.0/6.0 instance, contact O&M personnel.

    • yes
    • no
    • only-replica

    yes

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

    Number of seconds that the output buffer remains above client-output-buffer-slave-soft-limit before the client is disconnected.

    0–60

    60

    client-output-buffer-slave-hard-limit

    Hard limit (in bytes) on the output buffer of replica clients. Once the output buffer exceeds the hard limit, the client is immediately disconnected.

    0–17,179,869,184

    1,717,986,918

    client-output-buffer-slave-soft-limit

    Soft limit (in bytes) 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.

    0–17,179,869,184

    1,717,986,918

    maxmemory-policy

    The policy applied when the maxmemory limit is reached. Options:

    • 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
    • allkeys-lru
    • volatile-random
    • allkeys-random
    • volatile-ttl
    • noeviction
    • volatile-lfu
    • allkeys-lfu

    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 (in milliseconds).

    100–5000

    5000

    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.

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

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

    1000–50,000

    10,000

    proto-max-bulk-len

    Maximum size of a single element request (in bytes).

    1,048,576–536,870,912

    536,870,912

    repl-backlog-size

    The replication backlog size (bytes). 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

    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

    3600

    repl-timeout

    Replication timeout (in seconds).

    30–3600

    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

    • Set to 0: Latency monitoring is disabled.
    • Set to more than 0: All with at least this many ms of latency will be logged.

    By running the LATENCY command, you can perform operations related to latency monitoring, such as obtaining statistical data, and configuring and enabling latency monitoring.

    Proxy Cluster instances do not have this parameter.

    0–86,400,000 ms

    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.

    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)

    For more information, see the following note.

    Ex

    slowlog-log-slower-than

    The maximum amount of time allowed, in microseconds, for command execution. If this threshold is exceeded, Redis slow query log will record the command.

    0–1,000,000

    10,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

    auto-kill-timeout-lua-process

    yes: enable

    no: disable

    When this parameter is enabled, lua scripts 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
    • no

    no

    1. For more information about the parameters described in Table 1, visit the Redis official website.
    2. 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.
    3. More about the notify-keyspace-events parameter:
      • The parameter setting must contain at least a K or E.
      • A is an alias for "g$lshzxe" and 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.
    Table 2 DCS Memcached instance configuration parameters

    Parameter

    Description

    Value Range

    Default Value

    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. A setting of 0 means that this function is disabled.

    0–7200 seconds

    0

    maxclients

    The maximum number of clients allowed to be concurrently connected to a DCS instance.

    1000–10,000

    10,000

    maxmemory-policy

    The policy applied when the maxmemory limit is reached.

    • 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-lru

    allkeys-lru

    volatile-random

    allkeys-random

    volatile-ttl

    noeviction

    noeviction

    reserved-memory-percent

    Percentage of the maximum available memory reserved for background processes, such as data persistence and replication.

    0–80

    30

  7. Click Next: Confirm Parameters to confirm the instances and parameter values.

    • On the confirmation page, you can filter the desired instances selected in 4 by cache engine, instance type, and status, and modify the parameter value of these instances.
    • You can set different values for different instances within the value range. If the current value and new value of an instance are the same, no modification record will be generated for the instance.

  8. Click Submit.
  9. Click a DCS instance. On the instance details page that is displayed, choose Parameters > Modification History to check whether the configuration parameter is successfully modified.