A slow query is defined as a query statement that takes more time than the specified value, and the statement is called a slow query statement. The slow log analysis feature of TencentDB for Redis offers slow logs in two dimensions: instance and proxy.
- In the instance (Redis database instance) dimension, you can view the CPU utilization, number of slow logs, consumed time statistics by log segment, and information of the entire slow log list.
- In the proxy (middleware cluster node) dimension, you can view the proxy's slow log statistics, consumed time statistics by segment, and details of the slow log list.
Slow log analysis is often used as an important basis for database performance optimization. DBbrain is a cloud database autonomy service provided by Tencent Cloud for database performance optimization, security, and management, and the slow logs of TencentDB for Redis are connected to it for statistical analysis.
The slow log analysis feature of DBbrain is currently in beta test and free of charge. For more information, see Purchase Guide.
- The system logs operations with an execution time of more than 50 ms.
- The slow logs are retained for ten days.
- A default account can perform up to 15,000 queries per second, while a custom account can perform up to 20 queries per second.
- If the query is slow, you can narrow down the query time period.
Querying slow log
- Log in to the TencentDB for Redis console.
- Above the instance list on the right, select the region.
- In the instance list, find the target instance.
- Click the target instance ID to enter the Instance Details page.
- Click the Slow Log tab to enter the Redis Slow Log page. To query the slow logs generated by the proxy, select the Proxy Slow Log tab.
- Select the time period after Query Time Period, select the threshold for command request duration from the drop-down list after Average Execution Duration (> ms), click Query, and slow logs within the time period will be displayed.
Exporting slow log
- Click Export in the top-right corner of the Redis Slow Log or Proxy Slow Log page.
- In the pop-up window, view the limit on the number of slow logs that can be exported at a time, and click Export.
- Open the exported slow logs in Excel.
Analyzing slow log
- Click Slow Log Analysis in the top-right corner of the Redis Slow Log or Proxy Slow Log tab.
- On the Slow Log Analysis page of Performance Optimization in DBbrain, select the query time period and view the slow logs at the instance or proxy level as needed.