1. Background

2. Establishment of Redis clusterTo view

2.2 Extensions appear after compilation
LINK redis-server INSTALL redis-sentinel CC redis-cli.o LINK redis-cli CC redis-benchmark.o LINK redis-benchmark INSTALL  redis-check-rdb CC redis-check-aof.o LINK redis-check-aofCopy the code

3. Redis Cluster Benchmark,To view

Test command examples:

Redis-benchmark -h 127.0.0.1 -p 6379-c 10000-N 1000

10000 concurrent connections, 1000 requests, test redis server performance with host as localhost and port as 6379

Redis-benchmark -h 127.0.0.1 -p 6379-q -d 100

Test the performance of accessing a packet of 100 bytes size

PING_INLINE: 109769.48 requests per second PING_BULK: 107991.36 requests per second SET: 110864.74 Requests per second GET: 112233.45 Requests per second INCR: 115340.26 Requests per second LPUSH: 110864.74 Requests per second GET: 112233.45 Requests per second INCR: 115340.26 Requests per second LPUSH: 107181.13 Requests per second RPUSH: 102774.92 Requests per second ^COP: 101861.36Copy the code
Redis-benchmark -h 127.0.0.1 -p 6379 -t set,lpush -n 100000 -q
SET 116279.07 requests per second LPUSH: 116550.12 requests per secondCopy the code
3.4 redis-benchmark-n 100000 -q script load “redis. Call (‘set’,’foo’,’bar’)”
Redis-benchmark -h 127.0.0.1 -p 7000 -c 10000-N 1000 redis-benchmark -h 127.0.0.1 -p 7000 -c 10000-n 1000 redis-benchmark -h 127.0.0.1 -p 7000 -c 10000-n 1000
====== PING_INLINE ======
  1000 requests completed in0.14 seconds 10000 PARALLEL clients 3 bytes Payload keep alive: 1 milliseconds 2.10% <= 127 milliseconds <= 128 milliseconds 9.90% <= 129 millisecondsCopy the code

One host can handle 2w/s concurrent requests, 5w/s requests, and two machines can handle 4w/s concurrent requests, 10w/s requests

4. The Redis cluster will encounter pits

  • Distributed Cache Technology redIS Learning Series (4) — RedIS Advanced Applications (Cluster building, cluster partitioning principle, cluster operation)

  • Millions of concurrent data tests, view

5. Redis cluster configuration tuning

6. Monitoring of Redis cluster

7. Mechanism and algorithm of Redis cluster

  • The key-hash slot algorithm is used. The keys are algorithmically mapped to 16,834 slots.

8. Problems encountered

8.1 Centos Ruby is of an early version. Do I need to install a new version?
  • Ruby 2.3.* version of the installation, see
  • [/usr/bin/ruby: No such file or directory
8.2 Modifying a Cluster Node Fails
  • [ERR] Not all 16384 slots are covered by Nodes