Troubleshooting latency issues
Redis is designed to serve a large number of queries at an extremely fast speed. In most scenarios, there is a strict requirement for the response time between a client and the Redis Server. Therefore, high latency becomes the most fatal problem for the Redis online service. In this recipe, we will see how to measure and detect the latency of Redis, and also give you several possible clues to where the latency issue happens.
Getting ready…
You need to finish setting up the replication of the Redis Server as we described in the Setting up Redis replication recipe in Chapter 5, Replication.
For demonstration purposes, we populate a large amount of data:
for i in `seq 10` do nohup node generator.js hash 1000000 session:${i} & done
How to do it...
The first action is to do the baseline latency measurement:
- Before you put the Redis service online, run an
intrinsic-latency
test on the host where the Redis Server is running:
$ bin/redis-cli --intrinsic-latency 60
Max...