MONITOR(3valkey)
πΈ MONITOR(3valkey) β the valkey command manual, bestie edition πΈ
okay so this is the manual page for MONITOR from the Valkey Command Manual. yes it's a real page, yes it's iconic, let's get into it π
β¨ NAME β¨
monitor β Listens for all requests received by the server in real-time.
π¦ SYNOPSIS π¦
MONITOR
π DESCRIPTION π
okay so MONITOR is a debugging command that streams back every single command processed by the Valkey server. it's giving surveillance but make it helpful π it can help in understanding what is happening to the database. and the best part? this command can both be used via valkey-cli and via telnet. versatile queen π
the ability to see all the requests processed by the server is useful in order to spot bugs in an application both when using Valkey as a database and as a distributed caching system. literally your bug-hunting bestie ππ
$ valkey-cli monitor
1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
1339518087.877697 [0 127.0.0.1:60866] "dbsize"
1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
1339518096.506257 [0 127.0.0.1:60866] "get" "x"
1339518099.363765 [0 127.0.0.1:60866] "eval" "return server.call('set','x','7')" "0"
1339518100.363799 [0 lua] "set" "x" "7"
1339518100.544926 [0 127.0.0.1:60866] "del" "x"
Use SIGINT (Ctrl-C) to stop a MONITOR stream running via valkey-cli. know when to log off, periodt β
$ telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
MONITOR
+OK
+1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
+1339518087.877697 [0 127.0.0.1:60866] "dbsize"
+1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
+1339518096.506257 [0 127.0.0.1:60866] "get" "x"
+1339518099.363765 [0 127.0.0.1:60866] "del" "x"
+1339518100.544926 [0 127.0.0.1:60866] "get" "x"
QUIT
+OK
Connection closed by foreign host.
Manually issue the valkey-quit(7) QUIT or valkey-reset(7) RESET commands to stop a MONITOR stream running via telnet. manual exit, no drama π
π« 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 valkey-auth(7) AUTH. privacy first, always π«Ά
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. ngl bestie, it's not cheap π
Benchmark result without MONITOR running:
$ src/valkey-benchmark -c 10 -n 100000 -q
PING_INLINE: 101936.80 requests per second
PING_BULK: 102880.66 requests per second
SET: 95419.85 requests per second
GET: 104275.29 requests per second
INCR: 93283.58 requests per second
Benchmark result with MONITOR running (valkey-cli monitor > /dev/null):
$ src/valkey-benchmark -c 10 -n 100000 -q
PING_INLINE: 58479.53 requests per second
PING_BULK: 59136.61 requests per second
SET: 41823.50 requests per second
GET: 45330.91 requests per second
INCR: 41771.09 requests per second
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. it's giving "one more won't hurt" and then it absolutely does π
Note that, -valkey-auth(7)AUTHis excluded from the command's output. -valkey-reset(7)RESETcan be called to exit monitor mode. -AUTH,valkey-hello(7)HELLO,valkey-eval(7)EVAL,valkey-eval_ro(7)EVAL_RO,valkey-evalsha(7)EVALSHAandvalkey-evalsha_ro(7)EVALSHA_ROare included in the command's output.
π REPLY π
Non-standard return value. Dumps the received commands in an infinite flow. it literally never stops talking, main character energy fr fr π
π ACL CATEGORIES π
@admin @dangerous @slow
β HISTORY β
- Available since:
1.0.0β a legend since day one, no cap π
π SEE ALSO π
acl(3valkey)acl-cat(3valkey)acl-deluser(3valkey)acl-dryrun(3valkey)acl-genpass(3valkey)acl-getuser(3valkey)acl-help(3valkey)acl-list(3valkey)acl-load(3valkey)acl-log(3valkey)acl-save(3valkey)acl-setuser(3valkey)acl-users(3valkey)acl-whoami(3valkey)bgrewriteaof(3valkey)bgsave(3valkey)command(3valkey)command-count(3valkey)command-docs(3valkey)command-getkeys(3valkey)command-getkeysandflags(3valkey)command-help(3valkey)command-info(3valkey)command-list(3valkey)commandlog(3valkey)commandlog-get(3valkey)commandlog-help(3valkey)commandlog-len(3valkey)commandlog-reset(3valkey)config(3valkey)config-get(3valkey)config-help(3valkey)config-resetstat(3valkey)config-rewrite(3valkey)config-set(3valkey)dbsize(3valkey)debug(3valkey)failover(3valkey)flushall(3valkey)flushdb(3valkey)info(3valkey)lastsave(3valkey)latency(3valkey)latency-doctor(3valkey)latency-graph(3valkey)latency-help(3valkey)latency-histogram(3valkey)latency-history(3valkey)latency-latest(3valkey)latency-reset(3valkey)lolwut(3valkey)memory(3valkey)memory-doctor(3valkey)memory-help(3valkey)memory-malloc-stats(3valkey)memory-purge(3valkey)memory-stats(3valkey)memory-usage(3valkey)module(3valkey)module-help(3valkey)module-list(3valkey)module-load(3valkey)module-loadex(3valkey)module-unload(3valkey)psync(3valkey)replconf(3valkey)replicaof(3valkey)restore-asking(3valkey)role(3valkey)save(3valkey)shutdown(3valkey)slowlog(3valkey)slowlog-get(3valkey)slowlog-help(3valkey)slowlog-len(3valkey)slowlog-reset(3valkey)swapdb(3valkey)sync(3valkey)time(3valkey)
and that's the whole page bestie π«Ά this was Valkey version 9.0.0, dated 2025-10-21 β go forth, monitor responsibly, and don't leave it running in prod, i'm literally begging ππβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms