Updated on 2023-12-13 GMT+08:00

Querying Configuration Parameters

Function

This API is used to query the configuration parameters of a DCS instance.

URI

GET /v1.0/{project_id}/instances/{instance_id}/configs

Table 1 describes the parameters.
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID. For details on how to obtain the value of this parameter, see Obtaining a Project ID.

instance_id

String

Yes

ID of the instance to be queried.

Request

Request parameters

None

Example request

GET https://{dcs_endpoint}/v1.0/{project_id}/instances/{instance_id}/configs

Response

Response parameters

Table 2 describes the response parameters.
Table 2 Parameter description

Parameter

Type

Description

status

String

Current status of a DCS instance.

instance_id

String

DCS instance ID.

redis_config

Array

Array of configuration items of the DCS instance. For details, see Table 3.

config_status

String

DCS instance status that is being modified or has been modified. Options:

  • UPDATING
  • FAILURE
  • SUCCESS

config_time

String

Time at which the DCS instance is operated on. For example, 2017-03-31T12:24:46.297Z.

cluster_v1

Boolean

Instance type. If true is returned, the instance is a Proxy Cluster DCS Redis 3.0 instance. If false is returned, the instance is not a Proxy Cluster DCS Redis 3.0 instance.

Table 3 redis_config parameter description

Parameter

Type

Description

description

String

Configuration item description.

param_id

String

Configuration parameter ID. For the possible values, see the Parameter ID column in Table 4.

param_name

String

Configuration parameter name. For the possible values, see the Parameter Name column in Table 4.

param_value

String

Configuration parameter value.

default_value

String

Default value of the configuration parameter. For the possible values, see the Default Value column in Table 4.

value_type

String

Type of the configuration parameter value. For the possible values, see the Value Type column in Table 4.

value_range

String

Range of the configuration parameter value. For the possible values, see the Value Range column in Table 4.

node_role

String

If null or empty is returned, the node is a default node, that is, the Redis Server node. If proxy is returned, the node is a proxy node.

Table 4 describes the configuration parameters of a DCS instance.

Table 4 Configuration parameters of a DCS instance

Parameter ID

Parameter Name

Applicable Engine

Type

Description

Value Range

Default Value

1

timeout

Redis and Memcached

Integer

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.

0–7200 seconds

0

2

maxmemory-policy

Redis and Memcached

String

How Redis will select what to remove when maxmemory is reached.

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

volatile-lru

allkeys-lru

volatile-random

allkeys-random

volatile-ttl

noeviction

volatile-lfu

allkeys-lfu

noeviction or volatile-lru

The value range and default value depend on the instance version and type.

3

hash-max-ziplist-entries

Redis

Integer

When the number of entries in hashes is less than the value of this parameter, hashes are encoded using ziplist to save memory.

1–10,000

512

4

hash-max-ziplist-value

Redis

Integer

When the biggest entry in hashes does not exceed the length threshold indicated by this parameter, hashes are encoded using ziplist to save memory.

1–10,000

64

5

list-max-ziplist-entries

Redis

Integer

When the number of entries in lists is less than the value of this parameter, lists are encoded using ziplist to save memory.

1–10,000

512

6

list-max-ziplist-value

Redis

Integer

When the biggest entry in lists does not exceed the length threshold indicated by this parameter, lists are encoded using ziplist to save memory.

1–10,000

64

7

set-max-intset-entries

Redis

Integer

When a set is composed entirely of strings and the number of integers does not exceed the length threshold indicated by this parameter, the set is encoded using intset to save memory.

1–10,000

512

8

zset-max-ziplist-entries

Redis

Integer

When the number of entries in sorted sets is less than the value of this parameter, sorted sets are encoded using a ziplist to save memory.

1–10,000

128

9

zset-max-ziplist-value

Redis

Integer

When the biggest entry in sorted sets does not exceed the length threshold indicated by this parameter, sorted sets are encoded using ziplist to save memory.

1–10,000

64

10

latency-monitor-threshold

Redis

Integer

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.

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/docs/reference/optimization/latency-monitor/.

0–86,400,000 ms

0

12

reserved-memory

Redis

Integer

Reserved memory, which is the number of megabytes reserved for the backend to perform internal processing such as persistence and master/standby replication.

This parameter is available only for master/standby instances.

The size of the reserved memory can be adjusted, but must be in the value range described in the next column. NOTE: For more information about maximum available memory of each instance type, see DCS Service Overview.

0% to 50% of maximum memory space initially available to the instance and below the current free memory space. Unit: MB.

0

13

notify-keyspace-events

Redis

String

Keyspace event notification. If this parameter is configured, the Redis Sub/Pub feature will allow clients to receive an event when a Redis data set is modified.

If the parameter value is an empty character string or null, the default value Ex is used.

If the parameter value contains multiple characters, keyspace event notification is enabled and each character identifies a class of keyspace events for which Redis will send notifications.

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

E: Keyevent events, published with the __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 for maxmemory)

For more information, see the following note.

Ex

More about the notify-keyspace-events parameter:

  • Allowed characters are K, E, KE, A, g, l, s, h, z, x, e, and $. The parameter value must contain either 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.
Example response
{
    "status": "RUNNING",
    "instance_id": "c08fdc6e-5c25-4185-ab57-c0a5529b727f",
    "redis_config": [
        {
            "description": "How Redis will select what to remove when maxmemory is reached, You can select among five behaviors: volatile-lru : remove the key with an expire set using an LRU algorithm allkeys-lru : remove any key according to the LRU algorithm volatile-random: remove a random key with an expire set allkeys-random: remove a random key, any key volatile-ttl : remove the key with the nearest expire time (minor TTL) noeviction : don't expire at all, just return an error on write operations",
            "param_id": 2,
            "param_name": "maxmemory-policy",
            "param_value": "noeviction",
            "default_value": "noeviction",
            "value_type": "String",
            "value_range": "volatile-lru,allkeys-lru,volatile-random,allkeys-random,volatile-ttl,noeviction"
        },
        {
            "description": "Hashes are encoded using a memory efficient data structure when they have a small number of entries",
            "param_id": 3,
            "param_name": "hash-max-ziplist-entries",
            "param_value": "512",
            "default_value": "512",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "Hashes are encoded using a memory efficient data structure when the biggest entry does not exceed a given threshold",
            "param_id": 4,
            "param_name": "hash-max-ziplist-value",
            "param_value": "64",
            "default_value": "64",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "Lists are encoded using a memory efficient data structure when they have a small number of entries",
            "param_id": 5,
            "param_name": "list-max-ziplist-entries",
            "param_value": "512",
            "default_value": "512",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "Lists are encoded using a memory efficient data structure when the biggest entry does not exceed a given threshold",
            "param_id": 6,
            "param_name": "list-max-ziplist-value",
            "param_value": "64",
            "default_value": "64",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "When a set is composed of just strings that happen to be integers in radix 10 in the range of 64 bit signed integers.",
            "param_id": 7,
            "param_name": "set-max-intset-entries",
            "param_value": "512",
            "default_value": "512",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "Sorted sets are encoded using a memory efficient data structure when they have a small number of entries",
            "param_id": 8,
            "param_name": "zset-max-ziplist-entries",
            "param_value": "128",
            "default_value": "128",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "Sorted sets are encoded using a memory efficient data structure when the biggest entry does not exceed a given threshold",
            "param_id": 9,
            "param_name": "zset-max-ziplist-value",
            "param_value": "64",
            "default_value": "64",
            "value_type": "Integer",
            "value_range": "1-10000"
        },
        {
            "description": "Close the connection after a client is idle for N seconds (0 to disable)",
            "param_id": 1,
            "param_name": "timeout",
            "param_value": "0",
            "default_value": "0",
            "value_type": "Integer",
            "value_range": "0-7200"
        },
        {
            "description": "Only events that run in more time than the configured latency-monitor-threshold will be logged as latency spikes. If latency-monitor-threshold is set to 0, latency monitoring is disabled. If latency-monitor-threshold is set to a value greater than 0, all events blocking the server for a time equal to or greater than the configured latency-monitor-threshold will be logged.",
            "param_id": 10,
            "param_name": "latency-monitor-threshold",
            "param_value": "0",
            "default_value": "0",
            "value_type": "Integer",
            "value_range": "0-86400000"
        },
        {
            "description": "The total memory, in bytes, reserved for non-data usage.",
            "param_id": 12,
            "param_name": "reserved-memory",
            "param_value": "0",
            "default_value": "0",
            "value_type": "Integer",
            "value_range": "0-6553"
        },
        {
            "description": "Redis can notify Pub or Sub clients about events happening in the key space",
            "param_id": 13,
            "param_name": "notify-keyspace-events",
            "param_value": null,
            "default_value": null,
            "value_type": "regular",
            "value_range": "([KE]+([A]|[g$lshzxe]+)){0,11}"
        }
    ],
    "config_status": "SUCCESS",
    "config_time": ""
}

Status Code

Table 5 describes the status code of successful operations. For details about other status codes, see Table 1.

Table 5 Status code

Status Code

Description

200

Instance configurations queried successfully.