Database Autonomy Service (DAS) provides the latency insight feature that collects statistics about the latency of all commands and custom events. The latency statistics are accurate to the microsecond. You can use this feature to troubleshoot failures and performance issues of your Redis databases.

Prerequisites

  • An ApsaraDB for Redis instance is connected to DAS and is in the Accessed state.
  • The ApsaraDB for Redis instance is an Enhanced Edition (Tair) instance with local SSDs, and its version meets the following requirements:
    • The major version is Redis 5.0 or later. For information about how to upgrade the major version, see Upgrade the major version.
    • The minor version is Redis 1.6.9 or later. For information about how to update the minor version, see Update the minor version.
    Note This feature is available only to specific users currently but will be available to all users in the future.

Features

Redis 2.8.13 introduced a new feature called latency monitoring to help users 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.

In this connection, ApsaraDB for Redis provides the advanced latency insight feature. This feature can record up to 27 events and execution durations of all commands, and save all latency statistics within the last three days. For more information about the events, see the "Common events" section of this topic. Latency insight provides the following benefits:
  • Persistent: supports data persistence and latency spike tracing.
  • High-precision: allows all events to be monitored within microseconds.
  • 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.

Procedure

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Instance Monitoring.
  3. On the page that appears, click the ID of the database instance that you want to manage. The instance details page appears.
  4. In the left-side navigation pane, choose Request Analysis > Latency Insight.
  5. On the Latency Insight page, view the latency statistics within a specified time range.
    Note Only data of the last three days can be queried, and the time range must span within one hour.
    You can click a number corresponding to an event in the table. Then, a chart appears and shows the trend of the metric. You can also specify the metrics that you want to view on the chart by selecting the metric names in the drop-down list above the chart. pqus
    Metric Description
    Events The name of the event.
    Total The total number of occurrences of the event.
    Average Latency (μs) The average latency of the event. Unit: μs.
    Maximum Latency (μs) The highest latency of the event. Unit: μs.
    Aggregation of Instances (Latency < 1ms) The number of occurrences of the event where the latency is lower than 1 ms. You can click the zhankai icon to view finer-grained statistics, including the numbers of occurrences of the event where the 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.
    Note Counting method: The number of occurrences of the event where the 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 where the 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 where the latency is lower than 2 ms.
    Note Counting method: The number of occurrences of the event where the latency is from 1 ms to 2 ms is counted and presented under the <2ms category, and the number of occurrences of the event where the latency is longer than 33s is counted and presented under the >33s category. Other categories follow the same pattern.

Common events

Category Event Threshold Description
Memory eviction EvictionDel 30ms The amount of time required to evict a key.
EvictionLazyFree 30ms The amount of time required to evict a key by using the Lazyfree feature.
EvictionCycle 30ms The amount of time required to perform an eviction.
Memory defragmentation ActiveDefragCycle 100ms The amount of time required to defragment memory.
Rehash Rehash 100ms The amount of time required to perform a rehash.
Data structure upgrade ZipListConvertHash 30ms The amount of time required to convert a ziplist to a dictionary by means of hash encoding.
IntsetConvertSet 30ms The amount of time required to convert an intset to a set by means of set encoding.
ZipListConvertZset 30ms The amount of time required to convert a ziplist to a skiplist by means of ziplist encoding.
Append-only file (AOF) AofWriteAlone 30ms The uptime during an AOF write.
AofWrite 30ms The amount of time required to perform each AOF write. An AOF write can be of the AofWriteAlone, AofWriteActiveChild, or AofWritePendingFsync type.
AofFsyncAlways 30ms The amount of time required to perform a fsync operation on an AOF when the appendfsync option is set to 1.
AofFstat 30ms The amount of time required to obtain status information about an AOF.
AofRename 30ms The amount of time required to rename an AOF.
AofReWriteDiffWrite 30ms The amount of time consumed by an incremental AOF write performed by a parent process after its child process rewrites an AOF.
AofWriteActiveChild 30ms The amount of time required to perform an AOF write when other child processes are in progress.
AofWritePendingFsync 30ms The amount of time required to perform an AOF write when a fsync operation is in progress.
Redis database (RDB) file RdbUnlinkTempFile 50ms The amount of time required to delete a temporary RDB file after a bgsave child process is terminated.
Others Commands 30ms The amount of time required to run a command that is not tagged with fast.
FastCommand 30ms The amount of time required to run a command that is tagged with fast. For more information about such commands, see FastCommands.
EventLoop 50ms The amount of time required to have a main event loop running.
Fork 100ms The amount of time recorded in a parent process after the parent process is forked.
Transaction 50ms The actual amount of time consumed by a transaction.
PipeLine 50ms The amount of time consumed by a multi-threaded pipeline.
ExpireCycle 30ms The amount of time consumed by a regular deletion of an expired key.
SlotRdbsUnlinkTempFile 30ms The amount of time required to delete a temporary RDB file from a slot after a bgsave child process is terminated.
LoadSlotRdb 100ms The amount of time required to load an RDB file from a slot.
SlotreplTargetcron 50ms 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

Note The following table lists commands that are commonly used. For information about other commands, visit Commands | Redis. All ACL commands tagged with @fast are FastCommands. command
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