查询实例配置参数
功能介绍
查询指定实例的配置参数信息。
URI
GET /v1.0/{project_id}/instances/{instance_id}/configs
请求消息
请求参数
无。
请求示例
GET https://{dcs_endpoint}/v1.0/{project_id}/instances/{instance_id}/configs 响应消息
响应参数
参数 | 类型 | 说明 |
|---|---|---|
status | String | 实例运行状态。 |
instance_id | String | 实例ID。 |
redis_config | Array | 实例配置项数组。具体请参考表3。 |
config_status | String | 实例修改状态。
|
config_time | String | 实例操作时间。格式为:2017-03-31T12:24:46.297Z |
cluster_v1 | Boolean | 实例类型。返回true表示实例类型为Redis 3.0 Proxy Cluster,false表示为其他实例类型。 |
参数 | 类型 | 说明 |
|---|---|---|
description | String | 配置项的描述。 |
param_id | String | 配置参数ID。取值见表4“参数ID”列。 |
param_name | String | 配置参数名称。取值见表4“参数名称”列。 |
param_value | String | 配置参数值。 |
default_value | String | 配置参数的默认值。取值见表4“默认值”列。 |
value_type | String | 配置参数的值类型。取值见表4“参数类型”列。 |
value_range | String | 配置参数的取值范围。取值见表4“取值范围”列。 |
node_role | String | 返回null或空时,表示是默认的节点,即Redis数据节点;返回proxy时,表示Proxy节点。 |
缓存实例配置参数的说明见表4。
参数ID | 参数名称 | 参数类型 | 参数解释 | 取值范围 | 默认值 |
|---|---|---|---|---|---|
1 | timeout | Integer | 客户端与服务端连接空闲超时断开时间,参数设为0表示连接永不断开。 | 0~7,200,单位:秒 | 0 |
2 | maxmemory-policy | String | 内存使用达到上限时对缓存数据管理策略。 参数说明见Redis官网中关于Key逐出的说明。 | volatile-lru allkeys-lru volatile-random allkeys-random volatile-ttl noeviction volatile-lfu allkeys-lfu | noeviction/volatile-lru 取值与默认值与实例的版本及类型有关 |
3 | hash-max-ziplist-entries | Integer | 当hash表中记录数少于参数值,使用ziplist编码格式,节约内存。 | 1~10,000 | 512 |
4 | hash-max-ziplist-value | Integer | 当hash表中各字段长度的最大值小于参数值时,使用ziplist编码格式,节约内存。 | 1~10,000 | 64 |
5 | list-max-ziplist-entries | Integer | 当列表中记录数少于参数值,使用ziplist编码格式,节约内存。 | 1~10,000 | 512 |
6 | list-max-ziplist-value | Integer | 当列表中各字段长度的最大值小于参数值时,使用ziplist编码格式,节约内存。 | 1~10,000 | 64 |
7 | set-max-intset-entries | Integer | 当一个集合仅包含字符串且整型元素数量少于参数值时,使用intset编码格式,节约内存。 | 1~10,000 | 512 |
8 | zset-max-ziplist-entries | Integer | 当有序集合中记录数少于参数值,使用ziplist编码格式,节约内存。 | 1~10,000 | 128 |
9 | zset-max-ziplist-value | Integer | 当有序集合中各字段长度的最大值小于参数值时,使用ziplist编码格式,节约内存。 | 1~10,000 | 64 |
10 | latency-monitor-threshold | IntegerInteger | 延时监控的采样时间阈值(最小值)。 当阈值设置为0时,不做监控,也不采样;当阈值设置为大于0时,将监控并记录执行耗时大于阈值的操作。 用户可以通过LATENCY等命令获取统计数据和配置、执行采样监控。详情参考Redis官网说明。 | 0~86,400,000,单位:毫秒。 | 0 |
11 | maxclients | Integer | 设置同时连接的最大客户端数。 | 1,000-50,000 | 10,000 |
12 | reserved-memory | Integer | 预留内存,主备实例才有此配置。 预留内存将被分配给实例VM,保证DCS实例后台进程在做持久化和主从同步等任务时拥有足够的内存。 预留内存大小可以调高或者调低,但不能超过实例当前剩余的可用内存,以及最大可用内存的50%。其中实例最大可用内存可参考《分布式缓存服务用户指南》文档。 | 实例最大可用内存数的0-50%,同时不能超过实例当前剩余的可用内存,单位:MB。 | 0 |
13 | notify-keyspace-events | String | 键空间通知,配置该参数后客户端可以通过Redis的订阅与发布功能,来接收那些以某种方式改动了Redis数据集的事件。 | 可配置为以下字符的任意组合,指定了服务器该发送哪些类型的通知: K:键空间通知,所有通知以__keyspace@__为前缀。 E:键事件通知,所有通知以__keyevent@__为前缀。 g:DEL、EXPIRE、RENAME等类型无关的通用命令的通知。 $:字符串命令的通知。 l:列表命令的通知。 s:集合命令的通知。 h:哈希命令的通知。 z:有序集合命令的通知。 x:过期事件:每当有过期键被删除时发送。 e:驱逐(evict)事件:每当有键因为maxmemory政策而被删除时发送。 其他描述,请参考表格下方的说明。 | Ex |
14 | repl-backlog-size | Integer | 用于增量同步的复制积压缓冲区大小(单位为字节)。这是一个用来在从节点断开连接时,存放从节点数据的缓冲区,当从节点重新连接时,如果丢失的数据少于缓冲区的大小,可以用缓冲区中的数据开始增量同步。 | 16,384-1,073,741,824 | 1,048,576 |
15 | repl-backlog-ttl | Integer | 从节点断开后,主节点释放复制积压缓冲区内存的秒数。值为0时表示永不释放复制积压缓冲区内存。 | 0-604,800 | 3,600 |
16 | appendfsync | String | 操作系统的fsync函数刷新缓冲区数据到磁盘,有些操作系统会真正刷新磁盘上的数据,其他一些操作系统只会尝试尽快完成。 | Redis支持三种不同的调用 fsync的方式: no:不调用fsync,由操作系统决定何时刷新数据到磁盘,性能最高。 always:每次写AOF文件都调用fsync,性能最差,但数据最安全。everysec:每秒调用一次fsync。兼具数据安全和性能。 | everysec |
17 | appendonly | String | 指定是否在每次更新操作后进行日志记录,Redis在默认情况下是异步的把数据写入磁盘,如果不开启,可能会在断电时导致一段时间内的数据丢失。 | yes,no | yes |
18 | slowlog-log-slower-than | Integer | Redis慢日志会记录超过指定执行时间的命令。slowlog-log-slower-than用于配置记录到慢日志的命令执行时间阈值,单位为微秒。 | 0-1,000,000 | 10,000 |
19 | slowlog-max-len | Integer | 慢日志记录的条数。注意慢日志记录会消耗额外的内存。可以通过执行SLOWLOG RESET命令清除慢日志记录。 | 0-1000 | 128 |
20 | lua-time-limit | Integer | Lua脚本的最长执行时间,单位为毫秒。 | 100-5,000 | 5,000 |
21 | repl-timeout | Integer | 主从同步超时时间,单位为秒。 | 30-3,600 | 60 |
22 | proto-max-bulk-len | Integer | Redis协议中的最大的请求大小,单位为字节。 | 1,048,576-536,870,912 | 536,870,912 |
23 | master-read-only | String | 设置实例为只读状态。设置只读后,所有写入命令将返回失败。 | yes,no | no |
24 | client-output-buffer-slave-soft-limit | Integer | 对slave客户端output-buffer的软限制(单位为字节),如果output-buffer大于此值并且持续时间超过client-output-buffer-limit-slave-soft-seconds设置的时长,服务端会主动断开连接。 | 0~134,217,728 | 13,421,772 |
25 | client-output-buffer-slave-hard-limit | Integer | 对slave客户端output-buffer的硬限制(单位为字节),如果slave客户端output-buffer大于此值,服务端会主动断开连接。 | 0~134,217,728 | 13,421,772 |
26 | client-output-buffer-limit-slave-soft-seconds | Integer | slave客户端output-buffer超过client-output-buffer-slave-soft-limit设置的大小,并且持续时间超过此值(单位为秒),服务端会主动断开连接。 | 0-60 | 60 |
30 | reserved-memory-percent | Integer | 为非缓存内存使用保留的内存百分比。 | 0-80 | 0 |

notify-keyspace-events参数的说明如下:
- 有效值为[K|E|KE][A|g|l|s|h|z|x|e|$],即输入的参数中至少要有一个K或者E。
- A为“g$lshzxe”所有参数的集合别名。A与“g$lshzxe”中任意一个不能同时出现。
- 例如,如果只想订阅键空间中和列表相关的通知,那么参数就应该设为Kl。若将参数设为字符串"AKE"表示发送所有类型的通知。
{
"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": ""
} 
