How to monitor Azure Redis Cache

My workflow when developing using redis usually involves having a console running the MONITOR command to see the what flows through redis while I run my application.

I usually just use telnet, but couldn't get it running using the Azure Redis Cache. Instead I opted for the redis command line interface, redis-cli. This is what you need to do to get it running assuming you are working on a Windows machine.

Configure Azure Redis Cache

By default the Azure Redis Cache is not available without SSL. But since connecting to the cache with redis-cli using SSL doesn't work straight out of the box, the first order of business is to allow non-SSL connections for the test instance you want to monitor remotely.

Allowing non-SSL connections is straightforward, just find you Azure Redis Cache instance in the Azure Portal.

Enable non-SSL connections

If you want to use SSL you can do this by installing an SSL proxy like stunnel, check out this blog post from Redis Labs for more information. Thanks to @itamarhaber for suggesting this option!

Get the redis-cli

If you haven't got it already you should go get the redis-cli for Windows which is part of the Windows port maintained by MSOpenTech. You can either build it from source, or go get the most recently released binaries.

Connect using redis-cli

Navigate to the folder where redis-cli.exe is located and execute the command to connect to the cache using your hostname, port 6379 and your password (which you will also find in the Azure Portal).

.\redis-cli.exe -h <your-hostname>.redis.cache.windows.net -p 6379 -a <your-password>

Monitor!

Run the monitor command. And you should begin to see the traffic flowing through the cache.

> monitor
OK

That's it, you are now using monitor to spy on the traffic running through your Azure Redis Cache :)

View Comments