Modifying Configuration Parameters
On the DCS console, you can configure parameters for an instance to achieve optimal DCS performance.
You can modify the parameters of single-node and master/standby DCS instances in the Running state and cannot modify those of Proxy Cluster or Redis Cluster DCS instances.
- Log in to the DCS console.
- Click in the upper left corner of the management console and select a region and a project.
- In the navigation pane, choose Cache Manager.
- On the Cache Manager page, click the name of the DCS instance you want to configure.
- On the instance details page, click the Parameters tab.
- On the Parameters tab page, click Modify.
- Modify parameters based on your requirements.
Table 1 describes the parameters. In most cases, default values are retained.
Table 1 DCS instance configuration parameters
Redis and Memcached
Connection between the client and server (DCS instance) will be closed if the client is idle for the timeout period (measured in seconds). A timeout period of 0 seconds indicates that the timeout function is disabled.
Redis and Memcached
The policy applied when the maxmemory limit is reached.
For more information about this parameter, see https://redis.io/topics/lru-cache.
The maximum number of hashes that can be encoded using ziplist, a data structure optimized to reduce memory use.
The largest value allowed for a hash encoded using ziplist, a special data structure optimized for memory use.
The maximum number of list entries allowed before they are encoded using ziplist, a data structure optimized for memory use.
The largest value allowed for a list encoded using ziplist, a special data structure optimized for memory use.
If a set is composed entirely of strings that are integers in radix 10 within the range of 64 bit signed integers, the set is encoded using intset, a data structure optimized for memory use.
The maximum number of sorted sets that can be encoded using ziplist, a data structure optimized to reduce memory use.
The largest value allowed for a sorted set encoded using ziplist, a special data structure optimized for memory use.
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. For more information about the latency-monitor-threshold, visit https://redis.io/topics/latency-monitor.
This parameter is configurable only for master/standby instances.
The reserved memory is allocated to the VM where the instance is located. This ensures that the DCS instance background process has sufficient memory when performing tasks such as persistence and master/standby synchronization.
The reserved memory size can be increased or decreased, but cannot exceed the available memory of the instance and 50% of the maximum available memory. For more information about maximum available memory of each instance type, see Distributed Cache Service Product Introduction.
0% to 50% of maximum memory space initially available to the instance and below the current free memory space. For details, see prompts. Unit: MB.
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.
A string 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.
- For more information about the parameters described in Table 1, visit https://redis.io/topics/memory-optimization.
- 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.
- 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.
- After you have finished setting the parameters, click Save.
- Click Yes to confirm the modification.
Modifying Instance Configuration Parameters Using APIs
You can also call an API to modify the instance configuration parameters. For details, see the following API reference.