Use CloudDBA to identify slow queries running on your Tair (Redis OSS-compatible) instance. Slow requests decrease the stability of your instance—catching and resolving slow queries early helps maintain consistent performance.
Prerequisites
Before you begin, ensure that you have:
A Tair (Redis OSS-compatible) instance
Access to the Alibaba Cloud console
View slow query logs
Log on to the console and go to the Instances page. In the top navigation bar, select the region where your instance is deployed. Find the instance and click its ID.
In the left-side navigation pane, click CloudDBA > Slow Queries.
On the Slow Logs page, set a time range to load slow query data for that period.
The end time must be later than the start time, and the time range cannot exceed 24 hours. You can query logs from the previous month only.
Review the three sections on the page:
Slow Log Trend: Displays a time-series chart of slow query counts. Click any point on the chart to see the slow query logs recorded at that moment.
For cluster instances and read/write splitting instances, the chart shows separate slow query counts for data nodes and proxy nodes.
Event Distribution: Lists slow query events in the selected time range. Click an event to view its details.
Slow Log Details: Lists all slow queries in a table with the following columns:
Column
Description
Execution end time
When the command finished executing
Database name
The database the command ran against
Slow query statement
The command that exceeded the slow query threshold
Execution duration (ms)
How long the command took to execute, in milliseconds
Host address
The IP address of the client that sent the request
Click Set to show or hide columns.
To download the slow query logs to your computer, click the
icon.To debug a query using the OpenAPI console, click
to populate the selected parameters into the OpenAPI console.
Get the actual client IP address
For cluster instances and read/write splitting instances, Host address shows the IP address of the proxy node by default, not the originating client. To get the actual client IP address:
Tair (Enterprise Edition) performance-enhanced instances that use local disks: On the Parameter Settings tab of the instance details page, set the
ptod_enabledparameter to1. For details, see Configure parameters.Redis Open-Source Edition instances: Enable the audit log feature, then find the client IP address in the relevant events of the proxy node's audit logs. For details, see Audit logs.