Redis is used in Wikimedia production for:
- the MediaWiki job queue
- stashing user sessions ($wgSessionCacheType)
- log messages processed by Logstash
Check puppet and
jobqueue_aggregator to see where it runs (as of August 2016 the servers are rdb1001, rdb1003, rdb1005 and rdb1007).
You can use the
redis-cli utility to make queries against Redis. In order to make queries against Redis, you need to be on a production server
such as tin that can access the servers and has
redis-cli installed, and give the command.
- redis-cli -a password-here -h rdb1001
(Grab the password out of /srv/mediawiki/private/PrivateSettings.php on tin, the server where it runs, look for
$wmgRedisPassword in it.)
This will leave you at a redis prompt where you can enter commands interactively.
Some useful commands
info will give you a pile of status information about the server, including the number of keys near the end of the output.
keys pattern-here will give you a list of all keys matching the given pattern. Use this sparingly, there's a lot of keys in there and the query will take (at least) several seconds to complete.
quit closes the connection.
Commands are easy, they all depend on the data type (hash, set, list, etc). Here's a quick reference.
Configuration is likewise pretty straightforward with perhaps the exception of the snapshotting, aof and memory settings; here's the sample config file.