Site icon DataFLOQ

The Top 6 Free Redis Memory Analysis Tools

When it comes to analyzing the memory usage of a Redis instance, there are lots of free and open-source tools in the market, along with a smattering of paid products. Some of the most popular ones are Jacks (of all trades fame), but if you’re looking for a deeper analysis of your memory problems, you might be better off with one of the more targeted, and lesser-known tools.

In this post, we’ve compiled a list of the top 6 free tools we found most useful in analyzing memory usage of our Redis instances:

  1. Redis Memory Analyzer (RMA)
  2. Redis Sampler
  3. RDB Tools
  4. Redis-Audit
  5. Redis Toolkit
  6. Harvest

Read the full post: The Top 6 Free Redis Memory Analysis Tools


1) Redis Memory Analyzer

Redis Memory Analyzer (RMA) is one of the most comprehensive FOSS memory analyzers available for Redis. It supports three different levels of details:

Each mode has its own uses- you can get further details in the RMA ReadMe.

RMA – Global Mode

In the global mode, RMA provides some high-level statistics, like the number of keys, system memory, resident set size, keyspace size, etc. A unique feature is the keyspace overhead which is the memory used by the Redis system to store keyspace-related information, like pointers for the list data structures.

RMA – Scanner Mode

In the scanner mode, we get an overview of our keyspace. It gives the high-level namespaces (so a:b:1 and a:c:1 are clubbed together as a:*), along with the types of its items and the percentage of memory consumed by that namespace. It’s useful to start with this information and then use the RAM’ behavior coupled with the namespace pattern to do a detailed analysis.

RMA – RAM Mode

In the RAM mode, we get keyspace-level memory consumption, as provided by most of the other FOSS memory analyzers. So here, a:b:1 and a:c:1 are taken separately as a:b:* and a:c:* and we get detailed information about memory used, actual data size, overhead, encoding, min and max TTL, etc. This helps pinpoint the biggest memory-hoggers in our system.

Unfortunately, this tool is not always updated (the last commit on GitHub is more than a year ago). Even so, this is one of the best we found for detailed analysis.

RMA Installation and Usage:

RMA requires Python and PIP to be installed on the system (both are available for all major OSes). Once they’re installed, you can execute a single command to install the RDB tools – ` pip install rma`

It’s pretty simple to use from the command line. The syntax is `rma [-s HOST] [-p PORT] [-a PASSWORD] [-d DB] [-m pattern-to-match] [-l number-of-keys-to-scan] [-b BEHAVIOUR] [-t comma-separated-list-of-data-types-to-scan]`

RMA Pros:

RMA Cons:


2) Redis Sampler

Redis Sampler is a very powerful tool that can give deep insights into the memory usage of a Redis instance. It’s maintained by antirez, the developer behind Redis, and that deep knowledge of Redis shows through in this tool. The tool is not updated very frequently “ but there are not many issues reported anyway.

Redis Sampler does a probabilistic scan of the database and reports the following information:

Redis Sampler Installation and Usage:

This is a single Ruby script. It requires Ruby to be already installed. You also need `rubygems` and `redis` gems to be installed. Usage is pretty straightforward “ from the command line, execute `./redis-sampler.rb `

Redis Sampler Pros:

Redis Sampler Cons:


3) RDB Tools

RDB Tools is a very useful suite of tools for any serious Redis administrator. There is a tool for almost every use-case we could think of, but in this post, we’ll concentrate solely on the memory analysis tool. While nowhere near as comprehensive as RMA or Redis Sampler, RDB Tools gives 3 important pieces of information:

1) All keys where value has (serialized) size greater than B bytes [B specified by user].

2) The largest N keys [N specified by user].

3) Size of a particular key: this is read live from the database.

This suite has many active contributors on GitHub and is pretty frequently updated. RDB Tools is also well-documented on the internet. The maintainer sripathikrishnan is well known in the Redis community for the many tools he has provided over the years.

RDB Tools Installation and Usage:

RDB Tools requires Python and PIP to be installed on the system (both are available for all major OSes). Once they’re installed, you can execute a single command to install the RDB tools – ` pip install rdbtools python-lz`

Usage is pretty straightforward:

RDB Tools Pros:

RDB Tools Cons:


4) Redis-Audit

Redis-Audit is a probabilistic tool that’s useful for getting a quick overview of your memory usage. It outputs useful information on key groups, like overall memory consumption, maximum TTL in the group, average last access time, the percentage of keys in the group that expire, etc. This is the perfect tool if you need to find the most memory-hogging key group in your application.

Redis-Audit Installation and Usage:

You must have Ruby and Bundle already installed. Once installed, you can either clone the Redis-Audit repository to a folder or download the zip and unzip it to a folder. From that folder, run `bundle install` to complete the installation.

Usage is pretty straightforward: from the command line, execute ` redis-audit.rb hostname [port] [password] [dbnum] [sample_size]`

Redis-Audit Pros:

Redis-Audit Cons:


5) Redis Toolkit

Redis Toolkit is a bare-bones monitoring solution that can be used to analyze two key metrics: hit rate and memory consumption. The project is periodically updated for bug fixes but does not have the community support some of the more famous tools enjoy.

Redis Toolkit Installation and Usage:

You must have Docker installed on your system. Then, clone the GitHub repository (or download as zip and unzip to a folder). From that folder, installation is as simple as executing `./redis-toolkit install`.

Usage is purely via command line, through a series of simple commands.

Redis Toolkit Pros:

Redis Toolkit Cons:


6) Harvest

This is a probabilistic sampling tool, that can be used to identify the 10 largest namespaces/prefixes, in terms of the number of keys. It’s one of the newest tools and has not seen much traction on GitHub. But, if you’re a Redis novice looking to identify what kind of application data is clogging up your instance, you can’t get anything simpler than Harvest.

Harvest Installation and Usage:

This is downloadable as a Docker image. Once the image is ready, you can run the tool using the command docker run –link redis:redis -it –rm 31z4/harvest redis://redis-URL’ from the CLI.

Harvest Pros:

Harvest Cons:


Free Tool Limitations

While we found these tools very useful for debugging our Redis instances’ memory issues, you should be aware of the limitations of these free tools.

The paid tools almost always have some sort of data visualization, which is not available out-of-the-box with any of the tools we audited. The best you’ll get is a CSV output that you can use other FOSS tools to visualize, and many tools don’t even have that option. That makes for a steep learning curve, especially for novice Redis users. If you’re likely to do memory analysis often, it might be worthwhile to look at paid tools that provide good visualization.

Another limitation is the ability to store historical information. In keeping with the general *nix philosophy of making small tools that do just one thing, but do it well, the tools rarely venture into the monitoring space. Not even a memory consumption graph over time, and many can’t even analyze live data.

The Bottom line

One single tool will probably not suffice for all of your needs, but they’re pretty great weapons to have in your arsenal, paired with the monitoring capabilities provided by DBaaS services like ScaleGrid’s Redis hosting! To learn more about the great tools available with fully managed Redis hosting, check our Redis Features by Plan.

Exit mobile version