You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
Redis: Difference between revisions
(Added a few more known uses.)
|Line 46:||Line 46:|
<code>redis-cli</code> on servers redis-installed. This will leave you at a redis prompt where you can enter commands interactively.
This will leave you at a redis prompt where you can enter commands interactively.
===Some useful commands===
===Some useful commands===
<code></code> status information, including
<code>pattern-here</code> list of all keys matching the given pattern. Use this sparinglyquery take seconds to complete
<code></code> closes the connection.
Revision as of 08:22, 16 January 2019
Redis is used in Wikimedia production for:
- changeprop (role::redis::misc)
- stashing user sessions ($wgSessionCacheType) and the data stored in the main stash ($wgMainStash).
- As a cache and queue backend in ORES
- Receiver of sampled profile data from Xenon, as part as the sampling/profiling pipeline.
Role redis::misc (Redis 3.x)
redis::misc is for our general purpose master-slave cluster in eqiad and codfw DCs. Each
rdb* node has 5 instances (ports 6378, 6379, 6380, 6381, 6382) because redis is sigle threaded.
Each master has its respected slave. Masters use odd numbers (e.g. rdb1005) and slaves an even one (e.g. rdb1006). Master-slave instances use the same ports e.g.
rdb1005:6379 is the master of
- rdb1005 (m) - rdb1005 (s)
- rdb1009 (m) - rdb1010 (s)
- rdb2003 (m) - rdb2004 (s)
- rdb2005 (m) - rdb2006 (s)
Change propagation (or changeprop) is a service running on
scb* servers listening to topics on Kafka for events, and translates them into http requests to various systems. It is also responsible for cache evictions to happen on all services like RESTBase. Changeprop talks to redis via Nutcracker.
- Kibana changeprop Dashboard
Related puppet code
- Instance passwords can be easily found under
- Grafana redis::misc Dashboard
redis-cli is installed on all servers where redis-server is installed. This will leave you at a redis prompt where you can enter commands interactively.
Some useful commands
INFOstatus information, including:
# Replication role:slave master_host:10.64.0.24 master_port:6379 master_link_status:up master_last_io_seconds_ago:0 <snip> # Keyspace db0:keys=9351936,expires=9291239,avg_ttl=0
KEYS <pattern-here>list of all keys matching the given pattern. Use this sparingly! This query could take seconds to complete
QUITcloses 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.