Skip to content

Instantly share code, notes, and snippets.

@antirez
Created March 22, 2013 16:58
Show Gist options
  • Save antirez/5222946 to your computer and use it in GitHub Desktop.
Save antirez/5222946 to your computer and use it in GitHub Desktop.
------- data ------ --------------------- load -------------------- - child -
keys mem clients blocked requests connections
577999 113.36M 1 0 0 (+0) 1
748999 138.92M 1 0 1 (+0) 1
922999 169.01M 1 0 2 (+1) 1
1076999 211.63M 1 0 3 (+1) 1
1216999 235.84M 1 0 4 (+1) 1
1366999 253.78M 1 0 5 (+1) 1
1520999 280.39M 1 0 6 (+1) 1
1675999 307.18M 1 0 7 (+1) 1
1831999 334.15M 1 0 8 (+1) 1
1981999 360.09M 1 0 9 (+1) 1
2118999 417.14M 30 0 220 (+211) 30
2224999 434.10M 1 0 1127 (+907) 51
2346999 455.19M 1 0 1128 (+1) 51
2473999 477.15M 1 0 1129 (+1) 51
@mezzatto
Copy link

Hey Salvatore, I got a tool that I implemented back in 2010 (in C, using hiredis), inspired by redis-tools, that does this and much more. The default output is something like this:

INSTANCE PING db0 mem mem_real clients ops/s role
10.1.2.201:63770 0.157ms 330,080 101.07M 112.14M 2 39 master
10.1.2.201:63771 0.123ms 329,984 101.00M 112.10M 2 37 master
10.1.2.201:63772 0.131ms 329,338 100.84M 112.14M 2 43 master
10.1.2.201:63780 0.120ms 330,358 101.03M 112.44M 3 46 slave
10.1.2.201:63781 0.120ms 330,973 101.22M 112.30M 3 64 slave
10.1.2.201:63782 0.119ms 330,218 100.99M 112.59M 3 55 slave
10.1.2.202:63770 0.141ms 330,683 101.09M 112.01M 2 47 master
10.1.2.202:63771 0.135ms 330,325 101.05M 112.30M 2 42 master
10.1.2.202:63772 0.124ms 331,026 101.22M 112.38M 2 42 master
10.1.2.202:63780 0.135ms 330,080 101.03M 112.17M 3 35 slave
10.1.2.202:63781 0.137ms 329,984 100.98M 112.11M 3 42 slave
10.1.2.202:63782 0.125ms 329,338 100.84M 112.00M 3 40 slave
10.1.2.203:63770 0.104ms 330,270 101.00M 111.98M 2 43 master

AVERAGE: 0.129ms 330,204 101.03M 112.20M 2 44 -

TOTAL: 1.671ms 4,292,657 1.28G 1.42G 32 575 master[7]/slave[6]

But its possible to list anything that the INFO output spits. Like this:

INSTANCE PING aof_enabled redis_version rejected_connections
10.1.2.201:63770 0.146ms 0 2.6.2 0
10.1.2.201:63771 0.104ms 0 2.6.2 0
10.1.2.201:63772 0.155ms 0 2.6.2 0
10.1.2.201:63780 0.140ms 0 2.6.2 0
10.1.2.201:63781 0.132ms 0 2.6.2 0
10.1.2.201:63782 0.103ms 0 2.6.2 0
10.1.2.202:63770 0.122ms 0 2.6.2 0
10.1.2.202:63771 0.144ms 0 2.6.2 0
10.1.2.202:63772 0.151ms 0 2.6.2 0
10.1.2.202:63780 0.125ms 0 2.6.2 0
10.1.2.202:63781 0.124ms 0 2.6.2 0
10.1.2.202:63782 0.138ms 0 2.6.2 0
10.1.2.203:63770 0.149ms 0 2.6.2 0

AVERAGE: 0.133ms 0 - 0

TOTAL: 1.733ms 0 2.6.2[13] 0

Its also possible to run a "mass command" in lots of instances, like "CONFIG GET maxmemory":

./redis-top "$@" -s 5 -i 10.1.2.201:63770 -i 10.1.2.203:63770 -c "CONFIG GET maxmemory"
Instance: 10.1.2.201:63770
Type: 2 (array)
Elements: 2
Type: 1 (string)
(9) maxmemory
Type: 1 (string)
(9) 536870912

Instance: 10.1.2.203:63770
Type: 2 (array)
Elements: 2
Type: 1 (string)
(9) maxmemory
Type: 1 (string)
(9) 536870912

Interested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment