Queries the hot keys and the big keys in the memory in real time.
If the value of the Size parameter of a key ranks among the top three, the key is considered to be a big key. If the number of queries per second (QPS) of a key is greater than 3,000, the key is considered to be a hot key.
- When you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V4.3.3. We recommend that you use the latest version.
- The version of Database Autonomy Service (DAS) SDK must be V1.0.2 or later.
- When you call this operation to use DAS, you must specify cn-shanghai as the region.
- This operation is applicable only to ApsaraDB for Redis instances that meet the following
requirements:
- Community Edition, ApsaraDB for Redis V4.0 or V5.0, minor version 0.4.0 or later
- Enhanced Edition, ApsaraDB for Redis V5.0, minor version 1.5.1 or later
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeHotBigKeys |
The operation that you want to perform. Set the value to DescribeHotBigKeys. |
ConsoleContext | String | No | None |
A hidden parameter. |
InstanceId | String | Yes | r-bp18ff4a195d**** |
The ID of the ApsaraDB for Redis instance. You can call the DescribeInstances operation to query the ID. |
NodeId | String | No | r-****-db-0 |
The ID of the data shard on the ApsaraDB for Redis instance. You can call the DescribeRoleZoneInfo operation to query the ID. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Message | String | Successful |
The message returned for the request. |
RequestId | String | B6D17591-B48B-4D31-9CD6-9B9796B2**** |
The ID of the request. |
Data | Object |
The detailed information about the instance. |
|
HotKeys | Array of HotKey |
The details about the hot keys. |
|
HotKey | |||
Key | String | abc:def:eng |
The name of the key. |
Db | Integer | 0 |
The database in which the key is stored. |
Hot | String | 5500~6000 |
The number of QPS of the key. |
KeyType | String | zset |
The type of the key. |
Lfu | Integer | 253 |
The statistical value that is returned by using the least frequently used (LFU) caching algorithm. |
NodeId | String | r-x****-db-0 |
The ID of the data shard on the ApsaraDB for Redis instance. |
BigKeys | Array of BigKey |
The details about the big keys. |
|
BigKey | |||
Db | Integer | 0 |
The database in which the key is stored. |
Key | String | abc:def:eng |
The name of the key. |
KeyType | String | zset |
The type of the key. |
Size | Long | 2 |
The number of elements in the key. |
NodeId | String | r-x****-db-0 |
The ID of the data shard on the ApsaraDB for Redis instance. |
HotKeyMsg | String | current version doesn't support |
The reason why the hot key failed to be queried. |
BigKeyMsg | String | current version doesn't support |
The reason why the big key failed to be queried. |
Code | String | 200 |
The returned status code. |
Success | String | true |
Indicates whether the request is successful. Valid values:
|
Examples
Sample requests
http(s)://das.cn-shanghai.aliyuncs.com/?Action=DescribeHotBigKeys
&ConsoleContext=6c2e064b-a45f-4bd0-8a80-*********
&InstanceId=r-bp18ff4a195d****
&NodeId=r-****-db-0
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeHotBigKeysResponse>
<Message>Successful</Message>
<RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
<Data>
<HotKeys>
<Key>abc:def:eng</Key>
<Db>0</Db>
<Hot>5500~6000</Hot>
<KeyType>zset</KeyType>
<Lfu>253</Lfu>
<NodeId>r-x****-db-0</NodeId>
</HotKeys>
<BigKeys>
<Db>0</Db>
<Key>abc:def:eng</Key>
<KeyType>zset</KeyType>
<Size>2</Size>
<NodeId>r-x****-db-0</NodeId>
</BigKeys>
<HotKeyMsg>current version doesn't support</HotKeyMsg>
<BigKeyMsg>current version doesn't support</BigKeyMsg>
</Data>
<Code>200</Code>
<Success>true</Success>
</DescribeHotBigKeysResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Message" : "Successful",
"RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Data" : {
"HotKeys" : [ {
"Key" : "abc:def:eng",
"Db" : 0,
"Hot" : "5500~6000",
"KeyType" : "zset",
"Lfu" : 253,
"NodeId" : "r-x****-db-0"
} ],
"BigKeys" : [ {
"Db" : 0,
"Key" : "abc:def:eng",
"KeyType" : "zset",
"Size" : 2,
"NodeId" : "r-x****-db-0"
} ],
"HotKeyMsg" : "current version doesn't support",
"BigKeyMsg" : "current version doesn't support"
},
"Code" : "200",
"Success" : "true"
}
Error codes
For a list of error codes, visit the API Error Center.