When your Tair (Redis OSS-compatible) instance experiences high latency or timeouts, slow query logs help you identify which commands exceeded an execution time threshold and locate the root cause. Logs are generated at two levels—data nodes and proxy nodes—each measuring different parts of the request lifecycle.
Slow query logs are not supported for Redis Open-Source Edition 2.8 instances. To view slow logs for a 2.8 instance, go to CloudDBA > Slow Queries in the console. Slow logs for 2.8 instances do not include client IP addresses.
How slow query logs work
Tair generates slow query logs from two sources. Each source measures execution time differently and serves a different diagnostic purpose.
| Log source | What the duration measures | Retention | Recommended for |
|---|---|---|---|
| Data node | Time to run the command on the data node only. Excludes network transmission and queuing latency. In most cases, few slow query logs are generated on data nodes due to high instance performance. | 72 hours | Identifying slow commands at the engine level |
| Proxy node | Time from when the proxy sends the request to a data node until it receives the response. Includes command execution, network transmission, and queuing latency. | 72 hours | Troubleshooting timeout issues (closer to actual application latency) |
Storage is unlimited for both log sources.
Proxy node slow logs are not available for Standard instances.
Parameters
Data node parameters
| Parameter | Default | Unit | Description |
|---|---|---|---|
slowlog-log-slower-than | 20000 | Microseconds | Commands that run longer than this value are logged. 20000 microseconds equals 20 milliseconds. Because this value excludes network and queuing latency, actual end-to-end latency is typically higher. |
slowlog-max-len | 1024 | — | Maximum number of slow query log entries stored. |
Proxy node parameters
| Parameter | Default | Unit | Description |
|---|---|---|---|
rt_threshold_ms | 500 | Milliseconds | Commands that take longer than this value are logged. Set this close to your client timeout period, typically between 200 and 500 milliseconds. |
To modify these parameters, see Configure instance parameters.
View slow logs in the console
Log on to the console and go to the Instances page. In the top navigation bar, select the region where your instance resides, then click the instance ID.
In the left-side navigation pane, choose Logs > Slow Logs.
On the Slow Logs page, filter logs by time range or keyword. For cluster and read/write splitting instances, you can also filter by node type and node ID.
By default, the Host Address field shows proxy node IP addresses for cluster and read/write splitting instances. To display client IP addresses instead, set
ptod_enabledto1in Parameter Settings. For details, see Configure instance parameters.
Irrelevant slow log entries
Some entries reflect internal engine behavior rather than actual command performance. You can ignore the following entries.
| Entry | Description |
|---|---|
latency:eventloop | Tair (Redis OSS-compatible) runs in event-driven mode. An event loop covers reading, parsing, running commands, and returning results. The duration of latency:eventloop reflects the total time for one event loop cycle. |
latency:pipeline | In pipeline mode, the client sends commands and receives responses in batches. For cluster instances, proxy nodes use pipeline mode to send requests in batches to backend data nodes. The duration of latency:pipeline reflects the total time to process all requests in a pipeline batch. |
latency:fork | The duration of latency:fork reflects the time to fork a child process. Larger datasets result in longer fork times. |
API reference
| Operation | Description |
|---|---|
| DescribeSlowLogRecords | Retrieves slow query logs for an instance within a specified time range. |