Tair provides the latency insights feature in the CloudDBA module to collect latency statistics on all commands and custom events that are involved in databases. The statistics are accurate to the microsecond. The latency insights feature allows you to troubleshoot anomalies and performance issues of Tair databases.
Overview
Redis 2.8.13 introduced a new feature called latency monitoring to help identify and troubleshoot possible latency issues. The latency monitoring feature allows you to collect data generated only within the last 160 seconds and access only events that have the highest latency within each second.
Tair provides the advanced latency insights feature. This feature can record the execution durations of up to 27 events and all commands, and save all latency statistics within the last three days. The latency insights feature provides the following benefits:
Persistent: supports data persistence and latency spike tracing.
High-precision: allows full events to be monitored within milliseconds.
High-performance: supports asynchronous implementations with minimal impact on performance.
Real-time: supports real-time data queries and aggregation operations.
Multidimensional: provides comprehensive latency data that allows you to analyze an instance based on events, time, and latency.
Prerequisites
A DRAM-based instance of V1.6.9 or later is created. If you want to collect statistics on Tair module commands, update the minor version to 1.7.28 or later. For information about how to update the minor version, see Update the minor version of an instance.
Billing
This feature is available free of charge.
Procedure
Log on to the Tair console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.
In the left-side navigation pane, choose .
On the page that appears, specify the time range to query and then click Search. By default, statistics of the last 5 minutes are displayed.
For cluster and read/write splitting instances, you can view the statistics of data nodes and proxy nodes.
NoteOnly data of the last three days can be queried, and the time range to query must span within one hour.
Click the name of an event or a number corresponding to an event in the table. Then, a chart appears and shows the trend of the event-matched metric.
You can also specify the metrics that you want to view on the chart by selecting the metric names from the drop-down list above the chart.
NoteOnly commands or events that take longer than the specified amount of time to run or execute are recorded and displayed. For information about how to troubleshoot issues associated with instance latency, see Suggestions for handling common latency events.
Metric
Description
Event
The name of the event. Examples: ExpireCycle, EventLoop, Ping, Scan, Commands, and Info. For more information, see the "Common special events" section of this topic.
Total
The total number of occurrences of the event.
Average Latency (μs)
The average latency of the event. Unit: μs.
Maximum Latency (μs)
The maximum latency of the event. Unit: μs.
Aggregation of Instances (Latency < 1ms)
The number of occurrences of the event whose latency is lower than 1 ms. You can click the icon to view finer-grained statistics, including the numbers of occurrences of the event whose latency is lower than 1 μs, 2 μs, 4 μs, 8 μs, 16 μs, 32 μs, 64 μs, 128 μs, 256 μs, 512 μs, and 1 ms.
NoteCounting method: The number of occurrences of the event whose latency is from 0 μs to 1 μs is counted and presented under the <1μs category, and the number of occurrences of the event whose latency is from 1 μs to 2 μs is counted and presented under the <2μs category. Other categories follow the same pattern.
<2ms
<4ms
...
>33s
The number of occurrences of the event whose latency is lower than 2 ms.
NoteCounting method: The number of occurrences of the event whose latency is from 1 ms to 2 ms is counted and presented under the <2ms category, and the number of occurrences of the event whose latency is higher than 33s is counted and presented under the >33s category. Other categories follow the same pattern.
Common special events
Category | Event | Threshold | Description |
Memory eviction | EvictionDel | 30 ms | The amount of time required to delete evicted keys in a specific eviction cycle. |
EvictionLazyFree | 30 ms | The amount of time that background threads take to release the memory in a specific eviction cycle. | |
EvictionCycle | 30 ms | The amount of time required to perform an eviction. An eviction cycle involves the time required to select and delete data that you want to evict and the time spent on waiting for background threads. | |
Memory defragmentation | ActiveDefragCycle | 100 ms | The amount of time required to defragment memory. |
Rehash | Rehash | 100 ms | The amount of time required to perform a rehash. |
Data structure upgrade | ZipListConvertHash | 30 ms | The amount of time required to convert a ziplist to a dictionary by means of hash encoding. |
IntsetConvertSet | 30 ms | The amount of time required to convert an intset to a set by means of set encoding. | |
ZipListConvertZset | 30 ms | The amount of time required to convert a ziplist to a skiplist by means of ziplist encoding. | |
Append-only file (AOF) | AofWriteAlone | 30 ms | The amount of time required to write an AOF as expected. |
AofWrite | 30 ms | The amount of time required to write an AOF. Each time an AOF is successfully written, an AofWrite event and one of the following three events are recorded: AofWriteAlone, AofWriteActiveChild, and AofWritePendingFsync. | |
AofFstat | 30 ms | The amount of time required to obtain the information about an AOF. | |
AofRename | 30 ms | The amount of time required to rename an AOF. | |
AofReWriteDiffWrite | 30 ms | The amount of time consumed by an incremental AOF write performed by a parent process after its child process rewrites an AOF. | |
AofWriteActiveChild | 30 ms | The amount of time required to write an AOF to a disk. Other child processes may write data to the disk when the AOF is written. | |
AofWritePendingFsync | 30 ms | The amount of time required to write an AOF. A background process may be performing a fsync operation when the AOF is written. | |
Redis database (RDB) file | RdbUnlinkTempFile | 50 ms | The amount of time required to delete a temporary RDB file after a bgsave child process is terminated. |
Others | Commands | 30 ms | The amount of time required to run a command that is not tagged with fast. |
FastCommand | 30 ms | The amount of time required to run a command that is tagged with fast and has the time complexity of O(1) or O(log N). For more information about such commands, see the FastCommands section of this topic. | |
EventLoop | 50 ms | The amount of time required to run a main event loop. | |
Fork | 100 ms | The amount of time required to call a fork operation. | |
Transaction | 50 ms | The actual amount of time consumed by a transaction. | |
PipeLine | 50 ms | The amount of time consumed by a multi-threaded pipeline. | |
ExpireCycle | 30 ms | The amount of time required to clear expired keys at a time. | |
ExpireDel | 30 ms | The amount of time required to delete expired keys in a specific cycle for clearing the keys. | |
SlotRdbsUnlinkTempFile | 30 ms | The amount of time required to delete a temporary RDB file from a slot after a bgsave child process is terminated. | |
LoadSlotRdb | 100 ms | The amount of time required to load an RDB file from a slot. | |
SlotreplTargetcron | 50 ms | The amount of time required to load an RDB file from a slot to a temporary database and then migrate the file to a destination database by using a child process. |
FastCommands
The following table describes FastCommands that are commonly used. For information about other commands, visit the Commands page of the Redis official website. All access control list (ACL) commands tagged with @fast are FastCommands.
ACCOUNT | ADMINAUTH | ASKING | AUTH |
BKLIST | BZPOPMAX | BZPOPMIN | DBSIZE |
DECR | DECRBY | DISCARD | ECHO |
EXISTS | EXPIRE | EXPIREAT | Get |
GETBIT | HDEL | HEXISTS | HGET |
HINCRBY | HINCRBYFLOAT | HKCOUNTER | HKSWITCH |
HLEN | HMGET | HMINCRBY | HMINCRBYFLOAT |
HMSET | HSET | HSETNX | HSTRLEN |
INCR | INCRBY | INCRBYFLOAT | LASTSAVE |
LLEN | LPOP | LPUSH | LPUSHX |
MGET | MOVE | MULTI | PERSIST |
PEXPIRE | PEXPIREAT | PFADD | PING |
PTTL | PUBLISH | READONLY | READWRITE |
RENAMENX | RPOP | RPUSH | RPUSHX |
SADD | SCARD | SELECT | SETNX |
SISMEMBER | SMOVE | SPOP | SREM |
STRLEN | SWAPDB | TIME | TOUCH |
TTL | TYPE | UNLINK | UNWATCH |
WATCH | XACK | XADD | XCLAIM |
XDEL | XLEN | XSETID | XTRIM |
ZADD | ZCARD | ZCOUNT | ZINCRBY |
ZLEXCOUNT | ZPOPMAX | ZPOPMIN | ZRANK |
ZREM | ZREVRANK | ZSCORE | ZSCOREAVG |