README.markdown

Generating Redis Protocol

Generate the Redis protocol, in raw format, in order to use 'redis-cli --pipe' command to massively and quickly insert/delete.... keys in a redis server.
It accepts as input a pipe with redis commands formatted as "DEL key", "SET key value" ...

Usage:

Redis Copy

Redis Copy the keys in a source redis server into another target redis server.
The script probably needs to be added to a cron job if the keys are a lot because it only copies a fix number of keys at a time
and continue from there on the next run. It does this until there is no more keys to copy

Redis sharding

Reshard the keys in a number of source redis servers into another number of target cluster of redis servers
in order to scale an application.
The script probably needs to be added to a cron job if the keys are a lot because it only reshards a fix number of keys at a time
and continue from there on the next run. It does this until there is no more keys to reshard

IMPORTANT:

This script assume your target redis cluster of servers is based on a node system,
which is simply a host:port pair that points to a single redis-server instance.
Each node is given a symbolic node name "node_i" where i is the number gotten from this hashing system

str((abs(binascii.crc32(key) & 0xffffffff) % len(targets)) + 1)

to uniquely identify it in a way that doesn’t tie it to a specific host (or port).
e.g.

Redis Memory Stats

A memory size analyzer that parses the output of the memory report of rdb https://github.com/sripathikrishnan/redis-rdb-tools
for memory size stats about key patterns
At its core, RedisMemStats uses the output of the memory report of rdb, which echoes a csv row line for every key
stored to a Redis instance.
It parses these lines, and aggregates stats on the most memory consuming keys, prefixes, dbs and redis data structures.