Use Rdbtools to Generate Memory Report for Azure Cache for Redis and Convert Dump Files to JSON
Scenario:
The rdbtools is a handy utility that can parse Redis dump.rdb files, analyze memory, and export data to JSON. This tutorial shows a quick example using rdbtools to generate report for Azure cache for Redis, on memory usage and number of keys categorized by data type and data encoding.
Objective:
To showcase how to use the rdbtools to analyze memory use and data dumps from an Azure Cache for Redis. It is easy to use and gives more insights than the Memory Usage metrics available on the Azure portal.
Pre-requisites:
For this example, you would need:
- An Azure Cache for Redis in the Premium, Enterprise, or Enterprise Flash tiers.
Steps:
- Install rdbtools
- Add some data in the Redis
- Export data to dump
- Generate memory report
- Convert dump file to JSON
[STEP 1]: Install rdbtools
Note: Run the "pip install" command from the PowerShell. The "python-lzf" package accelerates the report generation. If you encounter the "Microsoft Visual C++ 14.0 is required" error, please install the C++ Build Tools from Visual Studio Installer as shown below. After installation in completed, add the script path which contains rdb.exe and redis-profiler.exe into the Path environment variable. For me, the script path is C:\Users\xxxxxx\AppData\Local\Programs\Python\Python39\Scripts.
[STEP 2]: Add some data in the Redis
Open "Console" from the Azure portal and run the following:
Note: Here I added 13 keys with various data types such as strings, lists, hashes, sets, and sorted sets.
[STEP 3]: Export data to rdb dump
Browse to the cache in the Azure portal and select "Export data" from the left menu. Pick a blob name prefix, select an output storage container, and then click "Export". After export is done, browse to the storage container and download the dump file.
[STEP 4]: Generate memory report
charlesredis1-report.html:
[STEP 5]: Convert dump file to JSON
Conclusion:
This example shows how to use the rdbtools to generate a memory report from an Azure Cache for Redis and convert the exported dump to JSON. The rdbtools analyzes the memory consumption of Redis keys as well as their data types. When it comes to improving the memory efficiency of a Redis cache, the rdbtools becomes a useful utility.
References:
Published on:
Learn moreRelated posts
Announcing the Private Preview of Cosmos DB Azure RBAC Integration
Introduction Managing access to Azure resources often means dealing with two separate permission models: one for management operations and ano...
Azure DocumentDB (with MongoDB compatibility) for Banking: A Modern Customer 360 Approach
Introduction: Transforming Customer Intelligence in Banking Every day, people interact with their bank across mobile apps, branches, call cent...
Exam AI-901: Microsoft Azure AI Fundamentals
With a massive amount of focus on AI across the Microsoft platform, I decided to sit the new AI-901 exam, which is the new Azure fundamentals ...
The problem: All-or-nothing batch processing in Azure Service Bus
Azure Functions lets you settle each Service Bus message on its own within a batch. Complete, abandon, dead-letter, or defer messages one by o...
Welcome to Azure Cosmos DB Conf 2026
Today is the day. Azure Cosmos DB Conf 2026, in partnership with AMD, is a free virtual developer event focused on building modern, scalable a...
Azure Data Studio is retired: Move your Azure SQL workflow to VS Code in 10 minutes
Azure Data Studio retired on February 28, 2026. The recommended path forward is Visual Studio Code with the MSSQL extension. If you used ADS d...