You can view the slow logs of an instance in the Tair console so that you can troubleshoot performance issues and optimize requests.
Slow logs record requests that take longer than a specified threshold to execute in ApsaraDB for Redis. Slow logs are classified into slow logs from data nodes and slow logs from proxy nodes.
|Slow log type
|Slow logs from data nodes
|Slow logs from proxy nodes
|rt_threshold_ms: the threshold of the command execution duration for slow logs from proxy nodes. Default value: 500. Unit: milliseconds. We recommend that you set the threshold to a value close to the client timeout period, which is from 200 milliseconds to 500 milliseconds.
- Log on to the ApsaraDB for Redis 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 its ID.
- In the left-side navigation pane, choose .
- Specify filter conditions to filter results based on your business requirements.
No. Description ① The node type and node ID.Note If the instance uses the standard architecture, only the slow logs from Data Node are displayed. In this case, skip this step. ② ③ The time range to query. By default, slow logs collected during the last hour are displayed. ④ The keyword that is specified to filter slow logs. Example: bgsave.Note By default, the Host Address parameter for master-replica cluster and read/write splitting instances displays the IP address of proxy nodes. To obtain the IP address of a specific client, set ptod_enabled to
1in System Parameters. For more information, see Modify the values of parameters for an instance.
Execution durations of specific slow SQL statements
Tair uses the event-driven mode during runtime. An event loop consists of reading, parsing, and running commands and returning outputs. A
latency:eventloopstatement indicates the amount of time consumed by an event loop.
Tair allows the client to work in pipeline mode. In this mode, the client sends commands and receives outputs in batches. If your instance uses the cluster architecture, proxy nodes use the pipelining mode to send requests in batches to the backend of Tair. A
latency:pipelinestatement indicates the amount of time consumed by a batch of client requests in pipelining mode.
The execution duration of a
latency:forkstatement indicates the amount of time required to fork a child process. The larger the amount of data, the longer the time required.
Related API operations
Queries the slow logs of an ApsaraDB for Redis instance that are generated during a specified period of time.