Queries the top 100 large keys over a specified period of time.

The list, hash, set, and zset keys are sorted based on the number of elements in these keys. The top three keys that have the most elements are considered large keys.

  • If you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than 4.3.3. We recommend that you use the latest version.
  • The version of DAS SDK must be 1.0.2 or later.
  • If you use an SDK to call Database Autonomy Service (DAS), you must set the region to cn-shanghai.
  • The DescribeTopBigKeys operation is available only for an ApsaraDB for Redis instance of one of the following versions:
    • The instance is ApsaraDB for Redis Community Edition instances that use a major version of 5.0 or later or a performance-enhanced instance of the ApsaraDB for Redis Enhanced Edition (Tair).
    • The ApsaraDB for Redis instance is updated to the latest minor version.
Note For more information about how to query and update the minor version of an instance, see ModifyInstanceMinorVersion and DescribeEngineVersion.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeTopBigKeys

The operation that you want to perform. Set the value to DescribeTopBigKeys.

ConsoleContext String No None

A reserved 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-x****-db-0

The ID of the data shard on the ApsaraDB for Redis instance. You can call the DescribeRoleZoneInfo operation to query the ID.

StartTime String Yes 1596177993000

The beginning of the time range to query. The value of this parameter is a UNIX timestamp. Unit: milliseconds.

EndTime String Yes 1596177993001

The end of the time range to query. The value of this parameter is a UNIX timestamp. Unit: milliseconds.

Note
  • The end time must be later than the start time.
  • Only data within the last 4 days can be queried.
  • The maximum interval between the start time and the end time is 3 hours.

Response parameters

Parameter Type Example Description
Message String Successful

The message that is returned for the request.

RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Data Array of BigKey

Details about the large keys.

Note If no large keys are found within the query period, no results are returned.
BigKey
Key String abc:def:eng

The name of the key.

Db Integer 0

The database in which the key is stored.

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.

Code String 200

The returned HTTP status code.

Success String true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=DescribeTopBigKeys
&ConsoleContext=6c2e064b-a45f-4bd0-8a80-*********
&InstanceId=r-bp18ff4a195d****
&NodeId=r-x****-db-0
&StartTime=1596177993000
&EndTime=1596177993001
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeTopBigKeysResponse>
    <Message>Successful</Message>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Data>
        <Key>abc:def:eng</Key>
        <Db>0</Db>
        <KeyType>zset</KeyType>
        <Size>2</Size>
        <NodeId>r-x****-db-0</NodeId>
    </Data>
    <Code>200</Code>
    <Success>true</Success>
</DescribeTopBigKeysResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "Successful",
  "RequestId" : "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Data" : [ {
    "Key" : "abc:def:eng",
    "Db" : 0,
    "KeyType" : "zset",
    "Size" : 2,
    "NodeId" : "r-x****-db-0"
  } ],
  "Code" : "200",
  "Success" : "true"
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParams The request parameters are invalid. The error message returned because the specified request parameters are invalid.

For a list of error codes, see Service error codes.