This topic describes how to use Database Autonomy Service (DAS) to enable, use, and disable slow query log analysis for Redis instances.

Prerequisites

ApsaraDB for Redis instances, self-managed Redis instances, or Redis instances that run on other clouds are connected to DAS.

Procedure

Enable slow query log analysis

By default, slow query log analysis is disabled. To enable the feature, perform the following operations:

  1. Log on to the DAS console.
  2. In the left-side navigation pane, click Instance Monitoring, and then find the instance. Make sure that the instance is in the Accessed state.
  3. Click the ID of the instance. On the instance details page, choose Request Analysis > Slow Logs in the left-side navigation pane. On the page that appears, click the Log Trend tab. On the Log Trend tab, click Enable Slow Log Analysis.
Note After about half an hour, you can view the details of slow queries, such as the general trends, the top slow queries, and the samples and sources of slow queries.

Slow query log trends

In the Slow Log Trend section, you can view the number of slow SQL statements for the instance by hour.

Note
  • You can click a dot in the chart to view the slow query log details that are collected at a specific period of time.
  • The slow query log analysis feature shows the slow query statistics and provides an easy method for you to find the most frequently executed slow SQL statement and the most time-consuming slow SQL statement.
  • You can click Sample in the Actions column to view the request details, which include the slow query log information and the client IP address.