Skip to content

Commit 97bb16a

Browse files
authored
DOC-2436 RS: Add more info about viewing & managing slow log (#1006)
1 parent b6cd354 commit 97bb16a

File tree

1 file changed

+66
-14
lines changed

1 file changed

+66
-14
lines changed

content/operate/rs/clusters/logging/redis-slow-log.md

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
Title: View Redis slow log
2+
Title: View and manage Redis slow log
33
alwaysopen: false
44
categories:
55
- docs
@@ -9,32 +9,32 @@ description: null
99
linkTitle: Slow log
1010
weight: $weight
1111
---
12-
On the **Databases** \> **Slowlog** page, you can view Slow Log details
13-
for Redis Enterprise Software databases.
1412

15-
[Redis Slow Log](http://redis.io/commands/slowlog) is one of the best
13+
[Redis slow log]({{<relref "/commands/slowlog">}}) is one of the best
1614
tools for debugging and tracing your Redis database, especially if you
1715
experience high latency and high CPU usage with Redis operations.
18-
Because Redis is based on a single threaded architecture, Redis Slow Log
16+
Because Redis is based on a single threaded architecture, Redis slow log
1917
can be much more useful than slow log mechanisms of multi-threaded
20-
database systems such as MySQL Slow Query Log.
18+
database systems such as MySQL slow query log.
2119

22-
Unlike tools that introduce lock overhead (which complicates the debugging
23-
process), Redis Slow Log is highly effective at showing the actual processing time of each command.
20+
Unlike tools that introduce lock overhead, which complicates the debugging
21+
process, Redis slow log is highly effective at showing the actual processing time of each command.
2422

25-
Redis Enterprise Software includes enhancements to the standard Redis
26-
Slow Log capabilities that allow you to analyze the execution time
23+
## Redis Software slow log enhancements
24+
25+
Redis Software includes enhancements to the standard Redis
26+
slow log capabilities that allow you to analyze the execution time
2727
complexity of each command. This enhancement can help you better analyze
2828
Redis operations, allowing you to compare the differences between
2929
execution times of the same command, observe spikes in CPU usage, and
3030
more.
3131

3232
This is especially useful with complex commands such as
33-
[ZUNIONSTORE](http://redis.io/commands/zunionstore),
34-
[ZINTERSTORE](http://redis.io/commands/zinterstore) and
35-
[ZRANGEBYSCORE](http://redis.io/commands/zrangebyscore).
33+
[ZUNIONSTORE]({{<relref "/commands/zunionstore">}}),
34+
[ZINTERSTORE]({{<relref "/commands/zinterstore">}}), and
35+
[ZRANGEBYSCORE]({{<relref "/commands/zrangebyscore">}}).
3636

37-
The enhanced Redis Enterprise Software Slow Log adds the **Complexity info** field to the
37+
The enhanced Redis Software slow log adds the **Complexity info** field to the
3838
output data.
3939

4040
View the complexity info data by its respective command in the table
@@ -70,3 +70,55 @@ below:
7070
| ZREVRANGE | N – number of elements in the zset</br>M – number of results | O(log(N)+M) |
7171
| ZREVRANK | N – number of elements in the zset | O(log(N)) |
7272
| ZUNIONSTORE | N – sum of element counts of all zsets</br>M – element count of result | O(N)+O(M\*log(M)) |
73+
74+
## View slow log
75+
76+
To view slow log entries for Redis Software databases, use one of the following methods:
77+
78+
- Cluster Manager UI:
79+
80+
1. To access the slow log in the Cluster Manager UI, your [cluster management role]({{<relref "/operate/rs/security/access-control/create-cluster-roles">}}) must be Admin, Cluster Member, or DB Member.
81+
82+
1. Select a database from the **Databases** list.
83+
84+
1. On the database's **Configuration** screen, select the **Slowlog** tab.
85+
86+
- Command line:
87+
88+
Use [`redis-cli`]({{<relref "/operate/rs/references/cli-utilities/redis-cli">}}) to run [`SLOWLOG GET`]({{<relref "/commands/slowlog-get">}}):
89+
90+
```sh
91+
redis-cli -h <endpoint> -p <port> SLOWLOG GET <count>
92+
```
93+
94+
## Change slow log threshold
95+
96+
The slow log includes all database commands that take longer than ten milliseconds (10,000 microseconds) by default. You can use [`redis-cli`]({{<relref "/operate/rs/references/cli-utilities/redis-cli">}}) to view or change this threshold.
97+
98+
To check the current threshold, run [`CONFIG GET`]({{<relref "/commands/config-get">}}):
99+
100+
```sh
101+
redis-cli -h <endpoint> -p <port> CONFIG GET slowlog-log-slower-than
102+
```
103+
104+
To change the threshold, run [`CONFIG SET`]({{<relref "/commands/config-set">}}):
105+
106+
```sh
107+
redis-cli -h <endpoint> -p <port> CONFIG SET slowlog-log-slower-than <value_in_microseconds>
108+
```
109+
110+
## Change maximum entries
111+
112+
The slow log retains the last 128 entries by default. You can use [`redis-cli`]({{<relref "/operate/rs/references/cli-utilities/redis-cli">}}) to view or change the maximum number of entries.
113+
114+
To check the current maximum, run [`CONFIG GET`]({{<relref "/commands/config-get">}}):
115+
116+
```sh
117+
redis-cli -h <endpoint> -p <port> CONFIG GET slowlog-max-len
118+
```
119+
120+
To change the maximum, run [`CONFIG SET`]({{<relref "/commands/config-set">}}):
121+
122+
```sh
123+
redis-cli -h <endpoint> -p <port> CONFIG SET slowlog-max-len <value>
124+
```

0 commit comments

Comments
 (0)