Debugging With Redis MONITOR

Published: October 12, 2017


Today I learned about the Redis MONITOR command. Running it is basically like tail -f-ing Redis…it prints every command issued against the Redis instance, kind of like varnishncsa.

Per the docs…

MONITOR is a debugging command that streams back every command processed by the Redis server

When you run it you’ll see something like this…

$ redis-cli monitor
1339518083.107412 [0] "keys" "*"
1339518087.877697 [0] "dbsize"
1339518090.420270 [0] "set" "x" "6"
1339518096.506257 [0] "get" "x"
1339518099.363765 [0] "del" "x"
1339518100.544926 [0] "get" "x"

The columns are as follows

MONITOR was invaluable in helping me debug an issue today. That being said, it’s probably not something you want to have running at all times…

Running a single MONITOR client can reduce the throughput by more than 50%. Running more MONITOR clients will reduce throughput even more.

Happy debugging!

Max Chadwick Hi, I'm Max!

I'm a software developer who mainly works in PHP, but also dabbles in Ruby and Go. Technical topics that interest me are monitoring, security and performance.

During the day I solve challenging technical problems at Something Digital where I mainly work with the Magento platform. I also blog about tech, work on open source and hunt for bugs.

If you'd like to get in touch with me the best way is on Twitter.