View performance monitoring data for an ApsaraDB for Tair (Redis-compatible) instance.
Operation description
For the console equivalent, see performance monitoring.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:DescribeHistoryMonitorValues |
get |
*DBInstance
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the instance. |
r-bp1zxszhcgatnx****** |
| StartTime |
string |
Yes |
The beginning of the time range to query. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. |
2022-11-06T00:00:00Z |
| EndTime |
string |
Yes |
The end of the time range to query. The end time must be later than the start time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
You can query monitoring data within the past month. The maximum time range to query is 7 days. |
2022-11-06T00:30:00Z |
| IntervalForHistory |
string |
Yes |
This parameter is deprecated and its value is fixed at The system automatically determines the query interval based on the specified start and end times. For example, if the specified time range is 10 minutes or less, data is aggregated every 5 seconds, and the query results are returned at 5-second intervals. Note
|
01m |
| MonitorKeys |
string |
No |
The monitoring metric to query, such as
For more information about monitoring metrics, see Additional information about the MonitorKeys parameter below. Note
|
CpuUsage |
| NodeId |
string |
No |
The ID of a node in the instance. You can use this parameter to query the monitoring data of a specific node. Note
|
r-bp1zxszhcgatnx****-db-0#1679**** |
| NodeRole |
string |
No |
If you want to query the metrics of a read-only node in a cloud-native instance that uses a read/write splitting architecture, you must specify the NodeId and set this parameter to READONLY. Note
In all other cases, you do not need to specify this parameter. You can also set it to MASTER. |
READONLY |
| Type |
string |
No |
MonitorKeys parameter
When you make an API call, pass a parameter from the MonitorKeys column in the following tables. The API returns the corresponding sub-metrics. An instance supports both general-purpose metrics and command statistics metrics.
General-purpose metrics
This section describes how to use general-purpose metrics, using CpuUsage as an example.
-
For instances that use the cluster or read/write splitting architecture:
To query the overall CPU utilization of all data nodes (DB), pass CpuUsage$db.
To query the overall CPU utilization of all proxy nodes, pass CpuUsage$proxy.
To query the CPU utilization of a single data node or proxy node, pass CpuUsage and set the
NodeIdparameter to the ID of the data or proxy node.
-
For instances that use the standard architecture (primary/standby), pass CpuUsage.
MonitorKeys | Sub-metric | Unit | Description | Supported scope |
CpuUsage | CpuUsage | % | CPU utilization. The value ranges from 0 to 100. Note If your instance previously used the |
|
MemoryUsage | memoryUsage | % | Memory usage. |
|
quotaMemory | quotaMemory | Bytes | The total memory of the current shard. |
|
UsedMemory | UsedMemory | Bytes | Used memory, which includes data and cache. |
|
Tair_PmemUsage | PmemUsage | % | These metrics represent the persistent memory usage, used persistent memory, and total persistent memory, respectively. Supported only by persistent memory instances. |
|
Tair_Pmem | PmemUsed | Bytes | ||
PmemQuota | Bytes | |||
Redis_DetailedSpaceUsage | ins_size | MB | These metrics represent the total disk space occupied by the instance, the disk space occupied by data files (including AOF and RDB files), and the disk space occupied by log files (including runtime logs), respectively. Supported only by memory-optimized instances that use the classic deployment mode (local disks). |
|
data_size | MB | |||
log_size | MB | |||
Redis_Memory_Monitor | used_memory_rss | Bytes | The physical memory that the operating system allocates to the Tair process. |
|
used_memory_lua | Bytes | The amount of memory used by Lua scripts. | ||
used_memory_startup | Bytes | The memory consumed when Tair starts. | ||
lazyfree_pending_objects | Counts | The number of keys pending reclamation when Tair performs a lazy free operation. | ||
used_memory_overhead | Bytes | The memory overhead required by Tair to maintain its internal data structures. This includes the output buffers of all clients, query buffers, and AOF. | ||
used_memory_dataset | Bytes | The memory space occupied by data. | ||
CustomerMemoryUsage | CustomerMemoryUsage | % | User memory usage. The value ranges from 0 to 100. |
|
UsedQPS | TotalQps | Counts/s | The total number of requests per second, including read and write commands. |
|
GetQps | Counts/s | The number of read and write requests per second, respectively. The instance must be compatible with Redis 4.0 or later. | ||
PutQps | Counts/s | |||
OtherOps | Counts/s | The number of requests that do not have read or write attributes, such as | ||
ConnectionUsage | connectionUsage | % | Connection usage is calculated by using the following formula: Established connections ÷ Total connections supported by the instance. This metric is a useful reference when a client connects to a Tair instance (cluster architecture) using a direct connection address. |
|
UsedConnection | ConnCount | Counts | The number of used connections. | |
IntranetIn | InFlow | KB/s | The inbound and outbound traffic rates. |
|
IntranetOut | OutFlow | KB/s | ||
IntranetInRatio | intranetInRatio | % | The usage percentage of the inbound and outbound traffic bandwidth. |
|
IntranetOutRatio | intranetOutRatio | % | ||
Redis_Avg_Rt_Monitor | AvgRt | us | The average latency, which is the average time a backend node takes to process a command from receipt to response.
|
|
Redis_Max_Rt_Monitor | MaxRt | us | The maximum latency, which is the maximum time a node takes to process a command from receipt to response.
| |
Redis_Basic_Monitor | Keys | Counts | The total number of top-level keys stored in the instance. |
|
Expires | Counts | The number of keys with an expiration time set. This is an instantaneous value measured at the time of collection. | ||
ExpiredKeys | Counts | The cumulative number of expired keys. | ||
EvictedKeys | Counts | The cumulative number of evicted keys. | ||
ExpiredKeysPerSecond | Counts/s | The number of keys that expire per second. | ||
EvictedKeysPerSecond | Counts/s | The number of keys that are evicted per second. | ||
inmem_keys | Counts | These metrics are supported only by hybrid storage instances (discontinued) and can be ignored. | ||
swapped_keys | Counts | |||
Hit_Rate_Monitor | hit_rate | % | The percentage of successful key lookups. Formula: Number of key hits / (Number of key hits + Number of key misses). |
|
hit | Counts | The number of key hits per second. | ||
miss | Counts | The number of key misses per second. | ||
evicted_keys_per_sec | Counts/s | The number of keys evicted per second. | ||
DiskUsage | disk_usage | % | These metrics represent disk usage, input buffer size, output buffer size, and disk performance. Supported only by disk-based instances. |
|
Tair_Connection_Monitor | UsedInputBuffer | Bytes | ||
UsedOutputBuffer | Bytes | |||
Tair_Disk_Monitor |
| %, ms, Counts, and more. | ||
UsedConnection | ConnectionUsage | % | Connection usage, calculated as: Used connections ÷ Maximum connections supported by the node. This metric is a useful reference when a client connects to a Tair instance (cluster or read/write splitting architecture) through a proxy node. |
|
UsedConnection | Counts | The number of used connections. | ||
NewUserConnQps | Counts/s | The number of connections established per second from clients to proxy nodes. | ||
Redis_Package_Monitor | request | Byte | The average size of a single request in bytes. |
|
response | Byte | The average size of a single response in bytes. | ||
request_max | Byte | The maximum size of a single request in bytes. | ||
response_max | Byte | The maximum size of a single response in bytes. | ||
RedisProxyConn | RedisUsedConnection | Counts | The number of connections from proxy nodes to data nodes. | |
NewDBConnQps | Counts/s | The number of connections established per second from proxy nodes to data nodes. | ||
DisconnectDBConn | Counts | The cumulative number of disconnections from proxy nodes to data nodes. | ||
DisconnectUserConn | Counts | The cumulative number of disconnections from clients to proxy nodes. | ||
TotalCalls | TotalRefusedCommands | Counts | The cumulative number of rejected commands. | |
TotalCallsPerSecCalls | Counts/s | The number of requests per second. | ||
TotalCallsPerSecRetryCalls | Counts/s | The number of retried requests per second. | ||
TotalCallsPerSecRetryFailed | Counts/s | The number of failed requests per second. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| MonitorHistory |
string |
The monitoring data returned as a JSON-formatted string. For more information, see Monitoring parameters. Note
To improve data transfer efficiency, the system returns only monitoring data for metrics with non-zero values. If a metric is not returned, its value is 0. |
"{\"2022-11-06T00:00:00Z\":{\"memoryUsage\":\"6.67\"},\"2022-11-06T00:00:05Z\":{\"memoryUsage\":\"6.67\"},\"2022-11-06T00:00:10Z\":{\"memoryUsage\":\"6.67\"},\"2022-11-06T00:00:15Z\":{\"memoryUsage\":\"6.67\"},\"2022-11-06T00:00:20Z\":{\"memoryUsage\":\"6.67\"},\"2022-11-06T00:00:25Z\":{\"memoryUsage\":\"6.67\"}}" |
| RequestId |
string |
The ID of the request. |
F0997EE8-F4C2-4503-9168-85177ED7**** |
Examples
Success response
JSON format
{
"MonitorHistory": "\"{\\\"2022-11-06T00:00:00Z\\\":{\\\"memoryUsage\\\":\\\"6.67\\\"},\\\"2022-11-06T00:00:05Z\\\":{\\\"memoryUsage\\\":\\\"6.67\\\"},\\\"2022-11-06T00:00:10Z\\\":{\\\"memoryUsage\\\":\\\"6.67\\\"},\\\"2022-11-06T00:00:15Z\\\":{\\\"memoryUsage\\\":\\\"6.67\\\"},\\\"2022-11-06T00:00:20Z\\\":{\\\"memoryUsage\\\":\\\"6.67\\\"},\\\"2022-11-06T00:00:25Z\\\":{\\\"memoryUsage\\\":\\\"6.67\\\"}}\"",
"RequestId": "F0997EE8-F4C2-4503-9168-85177ED7****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidStartTime.Malformed | The Specified parameter "StartTime" is not valid. | |
| 400 | InvalidEndTime.Malformed | The Specified parameter "EndTime" is not valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.