MONITOR
Syntax
Available since:
1.0.0
Time complexity:
ACL categories:
@admin
, @slow
, @dangerous
MONITOR
is a debugging command that streams back every command processed by the Redis server. It can help in understanding what is happening to the database. This command can both be used via redis-cli
and via telnet
.
The ability to see all the requests processed by the server is useful in order to spot bugs in an application both when using Redis as a database and as a distributed caching system.
Use SIGINT
(Ctrl-C) to stop a MONITOR
stream running via redis-cli
.
Manually issue the QUIT or RESET commands to stop a MONITOR
stream running via telnet
.
Commands not logged by MONITOR
Because of security concerns, no administrative commands are logged by MONITOR
's output and sensitive data is redacted in the command AUTH.
Furthermore, the command QUIT is also not logged.
Cost of running MONITOR
Because MONITOR
streams back all commands, its use comes at a cost. The following (totally unscientific) benchmark numbers illustrate what the cost of running MONITOR
can be.
Benchmark result without MONITOR
running:
Benchmark result with MONITOR
running (redis-cli monitor > /dev/null
):
In this particular case, running a single MONITOR
client can reduce the throughput by more than 50%. Running more MONITOR
clients will reduce throughput even more.
Return
Non standard return value, just dumps the received commands in an infinite flow.
Behavior change history
-
>= 6.0.0
: AUTH excluded from the command's output. -
>= 6.2.0
: "RESET can be called to exit monitor mode. -
>= 6.2.4
: "AUTH, HELLO, EVAL, EVAL_RO, EVALSHA and EVALSHA_RO included in the command's output.