Monitor the performance of 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 instance ID. |
r-bp1zxszhcgatnx**** |
| StartTime |
string |
Yes |
The start time of the query range. The time must be in the yyyy-MM-ddTHH:mm:ssZ format and in UTC. |
2022-11-06T00:00:00Z |
| EndTime |
string |
Yes |
The end time of the query range. This time must be later than the start time. The time must be in the yyyy-MM-ddTHH:mm:ssZ format and in UTC. Note
You can query data from within the last month. A single query can span a maximum of 7 days. |
2022-11-06T00:30:00Z |
| IntervalForHistory |
string |
Yes |
This parameter is deprecated. The value is fixed at The system automatically determines the query interval based on the specified start and end times. For example, if the time range is 10 minutes or less, the data aggregation frequency is 5 seconds, and returns data points every 5 seconds. Note
|
01m |
| MonitorKeys |
string |
No |
The metrics to query. To specify multiple metrics, separate them with a comma (,). For example, consider the
For more metrics and detailed descriptions, see Additional information about the MonitorKeys parameter. Note
|
CpuUsage |
| NodeId |
string |
No |
The ID of the node for which to query metrics. Note
|
r-bp1zxszhcgatnx****-db-0#1679**** |
| NodeRole |
string |
No |
To query metrics for a read-only node in a cloud-native read/write splitting instance, you must specify the NodeId and set this parameter to READONLY. Note
For all other scenarios, you can omit this parameter or set it to MASTER. |
READONLY |
| Type |
string |
No |
MonitorKeys parameter
When you call this API operation, pass a parameter from the MonitorKeys column in the tables below. This operation returns the corresponding sub-monitoring items. An instance supports both general and command statistics monitoring items.
General monitoring items
The following section describes how to use general monitoring items, using CpuUsage as an example.
-
For an instance with a cluster or read/write splitting architecture:
To query the overall CPU usage of all data nodes (DB), pass CpuUsage$db.
To query the overall CPU usage of all proxy nodes, pass CpuUsage$proxy.
To query the CPU usage of a single data node or proxy node, pass CpuUsage and specify the target node in the
NodeIdparameter.
-
For an instance with a standard (primary/standby) architecture, pass CpuUsage.
MonitorKeys | Sub-monitoring item | Unit | Description | Supported scope |
CpuUsage | CpuUsage | % | CPU usage. The value ranges from 0 to 100. Note If your instance previously passed or returned the |
|
MemoryUsage | memoryUsage | % | Memory usage. |
|
quotaMemory | quotaMemory | Bytes | The total memory of the current shard. |
|
UsedMemory | UsedMemory | Bytes | The amount of used memory, including data and cache. |
|
Tair_PmemUsage | PmemUsage | % | The usage, used amount, and total amount of persistent memory, respectively. These monitoring items are supported only by persistent memory instances. |
|
Tair_Pmem | PmemUsed | Bytes | ||
PmemQuota | Bytes | |||
Redis_DetailedSpaceUsage | ins_size | MB | The total disk space used by the instance, the disk space used by data files (including AOF and RDB files), and the disk space used by log files (including runtime logs), respectively. These monitoring items are supported only by memory-optimized instances in classic deployment mode (local disk). |
|
data_size | MB | |||
log_size | MB | |||
Redis_Memory_Monitor | used_memory_rss | Bytes | The physical memory used by the process, which is the memory allocated by the operating system to the Tair service. |
|
used_memory_lua | Bytes | The amount of memory used by Lua scripts. | ||
used_memory_startup | Bytes | The memory consumed by Tair at startup. | ||
lazyfree_pending_objects | Counts | The number of keys pending reclamation by Tair's lazy free process. | ||
used_memory_overhead | Bytes | The memory overhead required by Tair for internal data management. This includes all client output buffers, query buffers, and AOF. | ||
used_memory_dataset | Bytes | The memory space used by the dataset. | ||
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 | Requests that do not have read or write attributes, such as | ||
ConnectionUsage | connectionUsage | % | The percentage of used connections. Formula: |
|
UsedConnection | ConnCount | Counts | The number of used connections. | |
IntranetIn | InFlow | KB/s | The rate of inbound and outbound traffic. |
|
IntranetOut | OutFlow | KB/s | ||
IntranetInRatio | intranetInRatio | % | The usage rate of inbound and outbound traffic. |
|
IntranetOutRatio | intranetOutRatio | % | ||
Redis_Avg_Rt_Monitor | AvgRt | us | The average time from when a backend node receives a command to when it sends a response.
|
|
Redis_Max_Rt_Monitor | MaxRt | us | The maximum time from when a node receives a command to when it sends a response.
| |
Redis_Basic_Monitor | Keys | Counts | The total number of top-level keys stored in the instance. |
|
Expires | Counts | The number of keys with a configured expiration time. This value is a snapshot taken at the time of data collection. | ||
ExpiredKeys | Counts | The cumulative number of keys that have expired. | ||
EvictedKeys | Counts | The cumulative number of keys that have been evicted. | ||
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 monitoring items are supported only by hybrid storage instances (which are discontinued) and can be ignored. | ||
swapped_keys | Counts | |||
Hit_Rate_Monitor | hit_rate | % | The key hit rate. Formula: |
|
hit | Counts | The number of key hits per second. | ||
miss | Counts | The number of key misses per second. | ||
evicted_keys_per_sec | Counts | The number of keys evicted per second. | ||
DiskUsage | disk_usage | % | The disk usage, input buffer size, output buffer size, and disk performance monitoring items, respectively. These items are supported only by instances that use disk storage. |
|
RocksDBConn | Tair_Connection_Monitor | Bytes | ||
Tair_Connection_Monitor | Bytes | |||
Tair_Disk_Monitor | io_bandwidth_kbps, iops, iops_usage, etc. | %, ms, Counts, etc. | ||
UsedConnection | ConnectionUsage | % | The percentage of used connections. Formula: |
|
UsedConnection | Counts | The number of used connections. | ||
NewUserConnQps | Counts/s | The number of connections established per second from clients to a proxy node. | ||
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 request retries per second. | ||
TotalCallsPerSecRetryFailed | Counts/s | The number of failed requests per second. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| MonitorHistory |
string |
The monitoring information in JSON format. For more information, see Description of monitoring parameters. Note
To improve data transfer efficiency, this operation returns only non-zero monitoring data. Data points not included in the response default to 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 request ID. |
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.