dump.rdb · memory by type, key pattern and TTL

Redis RDB Analyzer

Open a Redis RDB snapshot to see which key patterns, types and individual keys take the space, how many keys expire and when, and whether the CRC64 checksum at the end of the file matches. Large values are streamed past, not loaded.

Snapshot

Drop a dump.rdb file

RDB versions 1 to 12 (Redis up to 7.4), up to 8.00 GB

A snapshot holds your key names and values. It is read in a worker in this tab. The memory column is a model of Redis's allocator, not a measurement.

Redis RDB Analyzer

Operator: Abdulla Al Fahad. How tools are built and checked

An RDB snapshot is Redis's point-in-time dump of every key, and when a production instance sits at 80% of its memory limit the dump is the cheapest way to learn what fills it. The file says what each key holds and how it is encoded; what it does not carry is a summary, so the work is walking it and grouping the keys.

Key features

  • Reads RDB versions 1 to 12 (Redis up to 7.4): strings, lists, sets, sorted sets, hashes and streams, plus the ziplist, listpack, intset, zipmap and quicklist encodings and LZF-compressed values
  • Totals by type, and by key pattern, where id-like segments (digits, UUIDs, long hex or random strings) are replaced by * so session:9f3a:data and session:12b8:data group as session:*:data
  • Biggest keys with type, encoding, element count, largest element and estimated memory, and a TTL view that measures expiry from the snapshot's own timestamp; analysis runs in a worker with a progress bar and Cancel, and keys, types, patterns and biggest keys export as CSV
  • Verifies the CRC64 at the end of the file and reports matches, does not match, or not stored

How an RDB file is read and where the memory figure comes from

The file starts with REDIS and four digits for the version, then a series of opcodes: 0xFA for auxiliary fields (redis-ver, ctime, used-mem), 0xFE to select a database, 0xFB for the table sizes, 0xFC and 0xFD for an expiry in milliseconds or seconds, and any other first byte is a value type followed by the key and value. A 0xFF marks the end, followed by an 8-byte CRC64 for version 5 and later.

Lengths use a variable encoding in which the top two bits choose a 6-bit, 14-bit, 32-bit or 64-bit length, or announce a special string encoding: an 8, 16 or 32-bit integer or an LZF-compressed block with its compressed and uncompressed lengths. Compact types store a whole list, hash or set as one string that holds a ziplist, listpack or intset; the page decompresses these and walks the entries to count elements and find the largest.

How it works

The file is read as a stream. Strings and large element lists are skipped as they pass, so a 2 GB snapshot is not loaded into memory; only compact blobs are buffered, each capped at 128 MB and all of them together at 4 GB of decompressed data.

The memory column is a model: jemalloc size classes for strings and sds keys, dict entries and buckets for hash tables, skiplist nodes for large sorted sets, and quicklist node overhead for lists. It lets you compare keys with each other. It is not INFO MEMORY, and Redis may re-encode a value on load.

Compact encodings are checked before they are counted. A listpack must state its own byte size and element count correctly, and every entry's back-length (the trailing bytes that let Redis walk the list backwards) must equal the entry's real size; a blob that fails any of these is reported as damaged instead of producing a wrong element count.

The CRC64 is the Jones polynomial variant Redis uses, computed over every byte up to and including the end marker. The implementation reproduces Redis's published check value for the string 123456789.

When this helps

  • An SRE sees an instance near its maxmemory and finds one pattern, cart:*:items, holding most of the estimated memory, with no TTL on any of its keys.
  • A developer migrating from Redis 6 to 7 opens a snapshot to confirm the version, the number of databases and whether any module type is present before restoring it.
  • A team lead wants to know whether sessions expire: the TTL tab shows the share of keys with no expiry against the share expiring in under a day.
  • An engineer chasing a latency spike every night sorts the biggest keys and finds one list with 4.2 million elements that a cleanup job removes with DEL. Freeing that many elements in one DEL blocks the server for as long as it takes, which is the case UNLINK exists for, since it frees the memory in a background thread.
  • A DBA verifies a backup copied across regions by checking that the CRC64 still matches.

Opening a file

  1. Copy the dump with redis-cli --rdb or from the data directory, and drop it in, or choose Load example.
  2. Watch the progress bar for a large file; Cancel stops the worker. A file cut short by an interrupted copy stops with a message that it is truncated, so copy it again and compare sizes.
  3. Check the banner for the CRC64 result before trusting any figure from the file.
  4. Open Key patterns first to see which families of keys take the memory, then Biggest keys for single outliers.
  5. Use TTL to see how many keys never expire, and Keys CSV to export the table.

Example

A snapshot of 62 invented keys, 8,811 bytes, written by this page rather than by a Redis server

40 session keys such as session:<hex>:data with expiries from 30 minutes to about a day
12 cache:product:<id>:html entries, LZF-compressed, three-day expiry
user profile hashes, a quicklist of email jobs, sets, a sorted set and a stream

Types, key patterns, TTL buckets and the biggest key

62 keys in db0, 6 types (54 strings, 2 lists, 2 hashes, 2 sets, 1 stream, 1 sorted set), CRC64 verified
patterns by estimated memory: cache:product:*:html 12 keys, session:*:data 40 keys, queue:emails 1 key; the estimated total is about 40 KB
TTL: 10 keys never expire, 8 under an hour, 32 between 1 and 24 hours, 12 between 1 and 7 days
biggest key: cache:product:4009:html, 2,635 bytes of HTML held in 91 bytes in the file

Tips for best results

  • A matching CRC64 means the file is intact since it was written; a snapshot saved with rdbchecksum no stores zero and cannot be checked.
  • Look at the element count next to the size. A hash of 10 million small fields is a different problem from one key holding 50 MB of JSON.
  • The pattern view groups by the key's shape, so changing the id segments you do not care about into * is already done; keys with unusual separators may need a look in the Keys table.

Limits

Hash fields with their own expiry, introduced in Redis 7.4, use value types this page does not read, and a snapshot that contains them stops with a message naming the type.

Module data types are skipped with their size counted, but their memory is a rough 16 bytes plus the stored bytes, since the page cannot know how the module lays them out in memory.

Only the first 300,000 keys are kept for the key table, the TTL view and the full CSV; type, pattern and biggest-key totals still cover every key.

Common errors and how to fix them

RDB version 80 is outside the 1 to 12 this page reads.
Valkey 8 numbers its snapshot format from 80, so its files are refused by version rather than read wrongly. Ask the server for a Redis-compatible dump if it can write one, or analyse the snapshot with the tool that ships with your Valkey release.
Unknown value type 24 (hash field expiration, added in Redis 7.4, is not read by this page).
The snapshot holds a hash with per-field expiry. The page stops instead of guessing at the layout, so no total is shown for such a file.
The file does not start with REDIS, so it is not an RDB snapshot.
An AOF file is a text log of commands and a RESP dump is something else. Use a dump.rdb from BGSAVE, redis-cli --rdb or the data directory.

Best practices

  • Take the snapshot from a replica or a restored copy when one exists: redis-cli --rdb makes the server fork to produce the dump, and on a busy primary the fork's copy-on-write pages add to its memory use while it runs.
  • Read the used-mem field printed in the file's header beside the page's estimated total. A large gap usually means the instance carried memory the snapshot does not hold, such as client output buffers or a replication backlog, rather than that the key figures are wrong.

Redis 8, Valkey and older snapshots

The version check is on the four digits after REDIS: 1 to 12 are read, anything else is refused with the number in the message. Redis 7.2 writes version 11 and Redis 7.4 writes 12, so a Redis 8 snapshot opens as long as it still declares a version up to 12 and holds only types the page knows; a type it does not know stops the analysis with a message naming the type, not with a partial total.

Valkey 7.2 kept Redis's numbering, so its snapshots should open like Redis 7.2's. Valkey 8 writes version 80, and a file that starts with VALKEY instead of REDIS is also turned away with a message saying so.

Frequently asked questions

Why does the CRC64 say not stored?

A server running with rdbchecksum no writes eight zero bytes where the checksum would be, and the page reports that as not stored instead of as a mismatch. The file may be perfectly sound; there is nothing to compare against.

Why is the memory figure different from what INFO reports?

INFO counts the real allocator state, including fragmentation, client buffers, replication backlog and the dictionary's own growth. The snapshot only holds the data, so the page models the data's footprint. Use the number to rank keys and patterns, and the used-mem field from the file's header to see what the server reported when it saved.

Does it show the contents of my keys?

Key names appear in the tables and exports, with control characters escaped, and values are not shown at all: strings are measured and skipped, and compact blobs are only counted.