How to know master/slave status of redis?

The INFO command returns the current role. e.g/ if we’re the master role:master will be shown, amongst other details. And if we switch to a slave, maybe by using slaveof: slaveof 192.168.1.66 6379 We get more, when we run INFO: role:slave master_host:192.168.1.66 master_port:6379 master_link_status:down master_last_io_seconds_ago:-1 master_sync_in_progress:0 master_link_down_since_seconds:1341313174 EDIT: Here’s a succinct cli command as shown … Read more

SCAN vs KEYS performance in Redis

You shouldn’t care about current command execution but about the impact to all other commands, since Redis processes commands using a single thread (i.e. while a command is being executed all others need to await until executing one ends). While keys or scan might provide you similar or identical performance executed alone in your case, … Read more

Redis / Get all keys & values from redis with prefix

HGETALL returns all fields and values of the hash stored at key, you can’t specify a mask: http://redis.io/commands/hgetall You can call KEYS doc:* to get a list of all keys matching your criteria and then get all values in a loop. But please read a section on potential performance hit before you do that: http://redis.io/commands/keys

Redis vs RocksDB

They have nothing in common. You are trying to compare apples and oranges here. Redis is a remote in-memory data store (similar to memcached). It is a server. A single Redis instance is very efficient, but totally non scalable (regarding CPU). A Redis cluster is scalable (regarding CPU). RocksDB is an embedded key/value store (similar … Read more

Redis is configured to save RDB snapshots, but is currently not able to persist on disk

When installing with brew the logfile is set to stdout. You need to edit /usr/local/etc/redis.conf and change logfile to something else. I set mine to: logfile /var/log/redis-server.log You’ll also make sure the user that runs redis has write permissions to the logfile, or redis will simply fail to launch completely. Then just restart redis: brew … Read more